diff --git a/.github/workflows/build-and-deploy.yaml b/.github/workflows/build-and-deploy.yaml deleted file mode 100644 index c3988180..00000000 --- a/.github/workflows/build-and-deploy.yaml +++ /dev/null @@ -1,25 +0,0 @@ ---- -name: Create and publish a Docker image - -on: - workflow_dispatch: - push: - branches: ['main'] - tags: ['v*'] - release: - types: [published] - -jobs: - build-and-push-image: - runs-on: ubuntu-latest - name: A job to build and push a docker image - permissions: - contents: read - packages: write - steps: - - id: build-push - uses: uclahs-cds/tool-Docker-action/build-release@latest - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - custom-tags: | - type=raw,enable=${{github.event_name == 'workflow_dispatch'}},branch=unstable,value=unstable diff --git a/.github/workflows/docker-build-release.yaml b/.github/workflows/docker-build-release.yaml new file mode 100644 index 00000000..cc83aece --- /dev/null +++ b/.github/workflows/docker-build-release.yaml @@ -0,0 +1,39 @@ +--- +name: Update image in GHCR + +run-name: > + ${{ + github.event_name == 'delete' && format( + 'Delete `{0}{1}`', + github.event.ref_type == 'branch' && 'branch-' || '', + github.event.ref + ) + || github.ref == 'refs/heads/main' && 'Update `dev`' + || format( + 'Update `{0}{1}`', + !startsWith(github.ref, 'refs/tags') && 'branch-' || '', + github.ref_name + ) + }} docker tag + +on: + workflow_dispatch: + push: + branches-ignore: ['gh-pages'] + tags: ['v*'] + delete: + +jobs: + push-or-delete-image: + runs-on: ubuntu-latest + name: Update GitHub Container Registry + permissions: + contents: read + packages: write + steps: + - uses: uclahs-cds/tool-Docker-action@v2.1.0 + with: + custom-tags: | + type=raw,enable=${{github.event_name == 'workflow_dispatch'}},branch=unstable,value=unstable + # Uncomment if you expect to use non-SemVer release tags + # non-semver-tags: true