use the short sha to tag images (#1313)
This commit is contained in:
parent
fef5986e9a
commit
62994ca264
1 changed files with 24 additions and 14 deletions
38
.github/workflows/docker.yaml
vendored
38
.github/workflows/docker.yaml
vendored
|
@ -3,8 +3,6 @@ name: build-docker
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
@ -38,6 +36,10 @@ jobs:
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
|
|
||||||
|
- name: Get short sha
|
||||||
|
id: shortsha
|
||||||
|
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Release build
|
- name: Release build
|
||||||
id: release_build
|
id: release_build
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
|
@ -49,9 +51,9 @@ jobs:
|
||||||
provenance: false
|
provenance: false
|
||||||
build-args: |
|
build-args: |
|
||||||
Version=dev
|
Version=dev
|
||||||
GitCommit=${{ github.sha }}
|
GitCommit=${{ steps.shortsha.outputs.short_sha }}
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ github.sha }}-amd64
|
ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}-amd64
|
||||||
|
|
||||||
|
|
||||||
publish_aarch64:
|
publish_aarch64:
|
||||||
|
@ -61,7 +63,7 @@ jobs:
|
||||||
permissions:
|
permissions:
|
||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
runs-on: actuated-aarch64
|
runs-on: actuated-arm64-4cpu-16gb
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
with:
|
with:
|
||||||
|
@ -84,6 +86,10 @@ jobs:
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
|
|
||||||
|
- name: Get short sha
|
||||||
|
id: shortsha
|
||||||
|
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Release build
|
- name: Release build
|
||||||
id: release_build
|
id: release_build
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
|
@ -95,9 +101,9 @@ jobs:
|
||||||
provenance: false
|
provenance: false
|
||||||
build-args: |
|
build-args: |
|
||||||
Version=dev
|
Version=dev
|
||||||
GitCommit=${{ github.sha }}
|
GitCommit=${{ steps.shortsha.outputs.short_sha }}
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ github.sha }}-aarch64
|
ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}-aarch64
|
||||||
|
|
||||||
publish_manifest:
|
publish_manifest:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -115,14 +121,18 @@ jobs:
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
|
|
||||||
|
- name: Get short sha
|
||||||
|
id: shortsha
|
||||||
|
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Create manifest
|
- name: Create manifest
|
||||||
run: |
|
run: |
|
||||||
docker manifest create 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:${{ github.sha }}-amd64 \
|
--amend ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}-amd64 \
|
||||||
--amend ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ github.sha }}-aarch64
|
--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:${{ github.sha }} ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ github.sha }}-amd64
|
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:${{ github.sha }} ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ github.sha }}-aarch64
|
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:${{ github.sha }}
|
docker manifest inspect ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}
|
||||||
|
|
||||||
docker manifest push ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ github.sha }}
|
docker manifest push ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue