2023-10-19 22:39:40 +02:00
|
|
|
name: build-docker
|
2021-11-17 12:41:55 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-10-19 22:41:14 +02:00
|
|
|
branches: [ main ]
|
2021-11-17 12:41:55 +01:00
|
|
|
|
|
|
|
jobs:
|
2023-10-19 22:39:40 +02:00
|
|
|
|
|
|
|
publish_x86:
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.ref }}-x86
|
|
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
|
|
packages: write
|
|
|
|
|
2023-10-19 22:45:58 +02:00
|
|
|
runs-on: ubuntu-latest
|
2021-11-17 12:41:55 +01:00
|
|
|
steps:
|
2023-10-19 22:39:40 +02:00
|
|
|
- uses: actions/checkout@master
|
|
|
|
with:
|
|
|
|
repository: atuinsh/atuin
|
|
|
|
path: "./"
|
2021-11-17 12:41:55 +01:00
|
|
|
|
2023-10-19 22:39:40 +02:00
|
|
|
- name: Setup mirror
|
|
|
|
uses: self-actuated/hub-mirror@master
|
2021-11-17 12:41:55 +01:00
|
|
|
|
2023-10-19 22:39:40 +02:00
|
|
|
- name: Get Repo Owner
|
|
|
|
id: get_repo_owner
|
|
|
|
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV
|
2022-05-09 22:09:31 +02:00
|
|
|
|
2023-10-19 22:39:40 +02:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Login to container Registry
|
2024-07-15 11:38:32 +02:00
|
|
|
uses: docker/login-action@v3
|
2021-11-17 12:41:55 +01:00
|
|
|
with:
|
2023-10-19 22:39:40 +02:00
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
registry: ghcr.io
|
|
|
|
|
2023-10-19 23:07:24 +02:00
|
|
|
- name: Get short sha
|
|
|
|
id: shortsha
|
|
|
|
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
|
|
|
|
2023-10-19 22:39:40 +02:00
|
|
|
- name: Release build
|
|
|
|
id: release_build
|
|
|
|
uses: docker/build-push-action@v4
|
|
|
|
with:
|
|
|
|
outputs: "type=registry,push=true"
|
|
|
|
platforms: linux/amd64
|
|
|
|
file: ./Dockerfile
|
|
|
|
context: .
|
|
|
|
provenance: false
|
|
|
|
build-args: |
|
|
|
|
Version=dev
|
2023-10-19 23:07:24 +02:00
|
|
|
GitCommit=${{ steps.shortsha.outputs.short_sha }}
|
2021-11-17 12:41:55 +01:00
|
|
|
tags: |
|
2023-10-19 23:07:24 +02:00
|
|
|
ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}-amd64
|
2023-10-19 22:39:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
publish_aarch64:
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.ref }}-aarch64
|
|
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
|
|
packages: write
|
|
|
|
|
2023-10-19 23:07:24 +02:00
|
|
|
runs-on: actuated-arm64-4cpu-16gb
|
2023-10-19 22:39:40 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@master
|
|
|
|
with:
|
|
|
|
repository: atuinsh/atuin
|
|
|
|
path: "./"
|
|
|
|
|
|
|
|
- name: Setup mirror
|
|
|
|
uses: self-actuated/hub-mirror@master
|
|
|
|
|
|
|
|
- name: Get Repo Owner
|
|
|
|
id: get_repo_owner
|
|
|
|
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV
|
2021-11-17 12:41:55 +01:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
2023-03-28 22:44:23 +02:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2023-10-19 22:39:40 +02:00
|
|
|
- name: Login to container Registry
|
2024-07-15 11:38:32 +02:00
|
|
|
uses: docker/login-action@v3
|
2021-11-17 12:41:55 +01:00
|
|
|
with:
|
2023-10-19 22:39:40 +02:00
|
|
|
username: ${{ github.repository_owner }}
|
2021-11-17 12:41:55 +01:00
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2023-10-19 22:39:40 +02:00
|
|
|
registry: ghcr.io
|
2021-11-17 12:41:55 +01:00
|
|
|
|
2023-10-19 23:07:24 +02:00
|
|
|
- name: Get short sha
|
|
|
|
id: shortsha
|
|
|
|
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
|
|
|
|
2023-10-19 22:39:40 +02:00
|
|
|
- name: Release build
|
|
|
|
id: release_build
|
2023-03-28 22:44:23 +02:00
|
|
|
uses: docker/build-push-action@v4
|
2021-11-17 12:41:55 +01:00
|
|
|
with:
|
2023-10-19 22:39:40 +02:00
|
|
|
outputs: "type=registry,push=true"
|
|
|
|
platforms: linux/arm64
|
2021-11-17 12:41:55 +01:00
|
|
|
file: ./Dockerfile
|
2023-10-19 22:39:40 +02:00
|
|
|
context: .
|
|
|
|
provenance: false
|
|
|
|
build-args: |
|
|
|
|
Version=dev
|
2023-10-19 23:07:24 +02:00
|
|
|
GitCommit=${{ steps.shortsha.outputs.short_sha }}
|
2023-10-19 22:39:40 +02:00
|
|
|
tags: |
|
2023-10-19 23:07:24 +02:00
|
|
|
ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}-aarch64
|
2023-10-19 22:39:40 +02:00
|
|
|
|
|
|
|
publish_manifest:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [publish_x86, publish_aarch64]
|
|
|
|
steps:
|
2023-10-19 23:21:24 +02:00
|
|
|
- uses: actions/checkout@master
|
|
|
|
with:
|
|
|
|
repository: atuinsh/atuin
|
|
|
|
path: "./"
|
2023-10-19 22:39:40 +02:00
|
|
|
|
|
|
|
- name: Get Repo Owner
|
|
|
|
id: get_repo_owner
|
|
|
|
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Login to container Registry
|
2024-07-15 11:38:32 +02:00
|
|
|
uses: docker/login-action@v3
|
2023-10-19 22:39:40 +02:00
|
|
|
with:
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
registry: ghcr.io
|
|
|
|
|
2023-10-19 23:07:24 +02:00
|
|
|
- name: Get short sha
|
|
|
|
id: shortsha
|
|
|
|
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
|
|
|
|
2023-10-19 22:39:40 +02:00
|
|
|
- name: Create manifest
|
|
|
|
run: |
|
2023-10-19 23:07:24 +02:00
|
|
|
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 }}
|
2023-10-19 22:39:40 +02:00
|
|
|
|