Test #106
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Test" | |
| # actions-up-ignore-file | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "18 18 * * 1,3,5" | |
| push: | |
| branches: ["**"] | |
| paths: | |
| - ".github/workflows/test.yaml" | |
| - "dist/**" | |
| - "src/**" | |
| - "package*.json" | |
| - "requirements*.txt" | |
| - "action.yml" | |
| - "Dockerfile" | |
| env: | |
| stack-name: "test_stack-context" | |
| jobs: | |
| test: | |
| name: "Test" | |
| if: ${{ !contains(github.event.head_commit.message, '#notest') }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 3 | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@v5 | |
| - name: "Debug event.json" | |
| if: ${{ !github.event.act }} | |
| continue-on-error: true | |
| run: cat "${GITHUB_EVENT_PATH}" | |
| - name: "Debug CTX github" | |
| if: ${{ !github.event.act }} | |
| continue-on-error: true | |
| env: | |
| GITHUB_CTX: ${{ toJSON(github) }} | |
| run: echo "$GITHUB_CTX" | |
| - name: "1: Before Context" | |
| continue-on-error: true | |
| run: | | |
| docker context ls | |
| - name: "1: Docker Context" | |
| if: ${{ !cancelled() }} | |
| uses: ./ | |
| with: | |
| host: ${{ secrets.DOCKER_HOST }} | |
| #port: ${{ secrets.DOCKER_PORT }} | |
| user: ${{ secrets.DOCKER_USER }} | |
| pass: ${{ secrets.DOCKER_PASS }} | |
| #ssh_key: ${{ secrets.DOCKER_SSH_KEY }} | |
| - name: "1: After Context" | |
| run: | | |
| docker context ls | |
| #docker context inspect | |
| #docker info | |
| docker ps -f "name=${{ env.stack-name }}" | |
| - name: "2: Write YAML" | |
| if: ${{ !cancelled() }} | |
| uses: teunmooij/yaml@cffa9c57cc8d70f64b649ec07cab7e4c49d14ba1 # v1.0.1 | |
| with: | |
| to-file: "docker-compose.yaml" | |
| data: | | |
| {"version":"3.8","services":{"alpine":{"image":"alpine:latest","command":"tail -f /dev/null"}}} | |
| - name: "2: Deploy Stack" | |
| run: | | |
| docker stack deploy -c docker-compose.yaml --detach=false "${{ env.stack-name }}" | |
| - name: "2: After Deploy" | |
| run: | | |
| docker ps -f "name=${{ env.stack-name }}" | |
| #docker stack rm "${{ env.stack-name }}" | |
| - name: "Schedule Failure Notification" | |
| if: ${{ failure() && github.event_name == 'schedule' }} | |
| uses: sarisia/actions-status-discord@v1 | |
| with: | |
| webhook: ${{ secrets.DISCORD_WEBHOOK }} | |
| description: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }} |