pin dataaxiom/ghcr-cleanup-action to commit SHA, bump version to 1.1.… #22
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docker — Build and Push | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Extract version tag | |
| id: tag | |
| env: | |
| REF_NAME: ${{ github.ref_name }} | |
| run: echo "VERSION=${REF_NAME#v}" >> "$GITHUB_OUTPUT" | |
| - name: Set up QEMU (for arm64 cross-compilation) | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ellipse2v | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ellipse2v/secopstm:latest | |
| ellipse2v/secopstm:${{ steps.tag.outputs.VERSION }} | |
| ghcr.io/ellipse2v/secopstm:latest | |
| ghcr.io/ellipse2v/secopstm:${{ steps.tag.outputs.VERSION }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Delete untagged GHCR versions | |
| uses: dataaxiom/ghcr-cleanup-action@d52806a0dc70b430571a37da1fde39733ffd640f # v1 | |
| with: | |
| package: secopstm | |
| delete-untagged: true | |
| delete-ghost-images: true |