🤬
  • ■ ■ ■ ■ ■
    .github/workflows/containers.yml
    1 1  name: Build and push containers
    2 2   
    3 3  on:
     4 + # Automatically triggered by a testing workflow passing
    4 5   workflow_run:
    5 6   workflows: ["ChangeDetection.io Test"]
    6 7   types: [completed]
    7 8   
     9 + # Or a new tagged release
    8 10   release:
    9 11   types: [created, published, edited]
    10 12   
    skipped 15 lines
    26 28   
    27 29   on-success:
    28 30   runs-on: ubuntu-latest
     31 + # If the testing workflow has a success, then we build to :latest
     32 + # Or if we are in a tagged release scenario.
    29 33   if: ${{ github.event.workflow_run.conclusion == 'success' }} || ${{ github.event.release.tag_name }} != ''
    30 34   steps:
    31 35   - uses: actions/checkout@v2
    skipped 42 lines
    74 78   version: latest
    75 79   driver-opts: image=moby/buildkit:master
    76 80   
     81 + # master always builds :latest
    77 82   - name: Build and push :latest
    78 83   id: docker_build
    79 84   if: ${{ github.ref == 'refs/heads/master'}}
    skipped 9 lines
    89 94   cache-from: type=local,src=/tmp/.buildx-cache
    90 95   cache-to: type=local,dest=/tmp/.buildx-cache
    91 96   
     97 + # A new tagged release is required, which builds :tag
    92 98   - name: Build and push :tag
    93 99   id: docker_build_tag_release
    94  - if: startsWith(github.ref, 'refs/tags/')
     100 + if: ${{ github.event.release.tag_name }} != ''
    95 101   uses: docker/build-push-action@v2
    96 102   with:
    97 103   context: ./
    98 104   file: ./Dockerfile
    99 105   push: true
    100 106   tags: |
    101  - ${{ secrets.DOCKER_HUB_USERNAME }}/changedetection.io:${{ steps.tagName.outputs.tag }}
    102  - ghcr.io/dgtlmoon/changedetection.io:${{ steps.tagName.outputs.tag }}
     107 + ${{ secrets.DOCKER_HUB_USERNAME }}/changedetection.io:${{ github.event.release.tag_name }}
     108 + ghcr.io/dgtlmoon/changedetection.io:${{ github.event.release.tag_name }}
    103 109   platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
    104 110   cache-from: type=local,src=/tmp/.buildx-cache
    105 111   cache-to: type=local,dest=/tmp/.buildx-cache
    skipped 15 lines
Please wait...
Page is in error, reload to recover