From ccf5707cca4e9cf737842eab3cb6ecd9891936a5 Mon Sep 17 00:00:00 2001 From: Nick Wiltsie Date: Fri, 16 Aug 2024 09:44:03 -0700 Subject: [PATCH] Update tool-Docker-action to v2.1.0 (#8) --- .github/workflows/Docker-build-release.yaml | 20 ------------ .github/workflows/docker-build-release.yaml | 36 +++++++++++++++++++++ 2 files changed, 36 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/Docker-build-release.yaml create mode 100644 .github/workflows/docker-build-release.yaml diff --git a/.github/workflows/Docker-build-release.yaml b/.github/workflows/Docker-build-release.yaml deleted file mode 100644 index b2313d4..0000000 --- a/.github/workflows/Docker-build-release.yaml +++ /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