diff options
author | Ellie Huxtable <ellie@elliehuxtable.com> | 2023-10-19 22:07:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-19 22:07:24 +0100 |
commit | 62994ca2643264cbfb61c48ab08b2392c4822d06 (patch) | |
tree | 80b2e69b06ec51804334e9065b48b762f06d17e3 | |
parent | fef5986e9ad610a110c99ca58fcaa02c75bb25c5 (diff) |
use the short sha to tag images (#1313)
-rw-r--r-- | .github/workflows/docker.yaml | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 433423e7..b56ccd92 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -3,8 +3,6 @@ name: build-docker on: push: branches: [ main ] - tags: - - 'v*' jobs: @@ -38,6 +36,10 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io + - name: Get short sha + id: shortsha + run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Release build id: release_build uses: docker/build-push-action@v4 @@ -49,9 +51,9 @@ jobs: provenance: false build-args: | Version=dev - GitCommit=${{ github.sha }} + GitCommit=${{ steps.shortsha.outputs.short_sha }} tags: | - ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ github.sha }}-amd64 + ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}-amd64 publish_aarch64: @@ -61,7 +63,7 @@ jobs: permissions: packages: write - runs-on: actuated-aarch64 + runs-on: actuated-arm64-4cpu-16gb steps: - uses: actions/checkout@master with: @@ -84,6 +86,10 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io + - name: Get short sha + id: shortsha + run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Release build id: release_build uses: docker/build-push-action@v4 @@ -95,9 +101,9 @@ jobs: provenance: false build-args: | Version=dev - GitCommit=${{ github.sha }} + GitCommit=${{ steps.shortsha.outputs.short_sha }} tags: | - ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ github.sha }}-aarch64 + ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}-aarch64 publish_manifest: runs-on: ubuntu-latest @@ -115,14 +121,18 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io + - name: Get short sha + id: shortsha + run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Create manifest run: | - docker manifest create ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ github.sha }} \ - --amend ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ github.sha }}-amd64 \ - --amend ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ github.sha }}-aarch64 - docker manifest annotate --arch amd64 --os linux ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ github.sha }} ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ github.sha }}-amd64 - docker manifest annotate --arch arm64 --os linux ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ github.sha }} ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ github.sha }}-aarch64 - docker manifest inspect ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ github.sha }} - - docker manifest push ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ github.sha }} + docker manifest create ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }} \ + --amend ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}-amd64 \ + --amend ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}-aarch64 + docker manifest annotate --arch amd64 --os linux ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }} ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}-amd64 + docker manifest annotate --arch arm64 --os linux ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }} ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}-aarch64 + docker manifest inspect ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }} + + docker manifest push ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }} |