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