Fixing workflow tag syntax issues

pull/245/head 0.39.2
dgtlmoon 3 years ago
parent db1ff1843c
commit 4267bda853

@ -1,10 +1,12 @@
name: Build and push containers name: Build and push containers
on: on:
# Automatically triggered by a testing workflow passing
workflow_run: workflow_run:
workflows: ["ChangeDetection.io Test"] workflows: ["ChangeDetection.io Test"]
types: [completed] types: [completed]
# Or a new tagged release
release: release:
types: [created, published, edited] types: [created, published, edited]
@ -26,6 +28,8 @@ jobs:
on-success: on-success:
runs-on: ubuntu-latest runs-on: ubuntu-latest
# If the testing workflow has a success, then we build to :latest
# Or if we are in a tagged release scenario.
if: ${{ github.event.workflow_run.conclusion == 'success' }} || ${{ github.event.release.tag_name }} != '' if: ${{ github.event.workflow_run.conclusion == 'success' }} || ${{ github.event.release.tag_name }} != ''
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -74,6 +78,7 @@ jobs:
version: latest version: latest
driver-opts: image=moby/buildkit:master driver-opts: image=moby/buildkit:master
# master always builds :latest
- name: Build and push :latest - name: Build and push :latest
id: docker_build id: docker_build
if: ${{ github.ref == 'refs/heads/master'}} if: ${{ github.ref == 'refs/heads/master'}}
@ -89,17 +94,18 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache
# A new tagged release is required, which builds :tag
- name: Build and push :tag - name: Build and push :tag
id: docker_build_tag_release id: docker_build_tag_release
if: startsWith(github.ref, 'refs/tags/') if: ${{ github.event.release.tag_name }} != ''
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: ./ context: ./
file: ./Dockerfile file: ./Dockerfile
push: true push: true
tags: | tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/changedetection.io:${{ steps.tagName.outputs.tag }} ${{ secrets.DOCKER_HUB_USERNAME }}/changedetection.io:${{ github.event.release.tag_name }}
ghcr.io/dgtlmoon/changedetection.io:${{ steps.tagName.outputs.tag }} ghcr.io/dgtlmoon/changedetection.io:${{ github.event.release.tag_name }}
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7 platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
cache-from: type=local,src=/tmp/.buildx-cache cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache

Loading…
Cancel
Save