From 52417e3729f52f9f1b7822e1e62c5bb5eb9b3f4b Mon Sep 17 00:00:00 2001 From: Nicholas Wiltsie Date: Thu, 15 Aug 2024 13:58:00 -0700 Subject: [PATCH] Update tool-Docker-action to v2.1.0 --- .github/workflows/Docker-build-release.yml | 20 ------------ .github/workflows/docker-build-release.yaml | 36 +++++++++++++++++++++ 2 files changed, 36 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/Docker-build-release.yml create mode 100644 .github/workflows/docker-build-release.yaml diff --git a/.github/workflows/Docker-build-release.yml b/.github/workflows/Docker-build-release.yml deleted file mode 100644 index b2313d4..0000000 --- a/.github/workflows/Docker-build-release.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -on: - 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 }} diff --git a/.github/workflows/docker-build-release.yaml b/.github/workflows/docker-build-release.yaml new file mode 100644 index 0000000..4ee63d6 --- /dev/null +++ b/.github/workflows/docker-build-release.yaml @@ -0,0 +1,36 @@ +--- +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: + 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 + # This argument makes the action match non-semver tags + with: + non-semver-tags: true