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 ]
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
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
|
|
|
|
|
|
|
|
runs-on: actuated
|
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
|
|
|
|
|
|
|
|
- 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
|
|
|
|
GitCommit=${{ github.sha }}
|
2021-11-17 04:41:55 -07:00
|
|
|
tags: |
|
2023-10-19 14:39:40 -06:00
|
|
|
ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ github.sha }}-amd64
|
|
|
|
|
|
|
|
|
|
|
|
publish_aarch64:
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.ref }}-aarch64
|
|
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
|
|
packages: write
|
|
|
|
|
|
|
|
runs-on: actuated-aarch64
|
|
|
|
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 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
|
|
|
|
GitCommit=${{ github.sha }}
|
|
|
|
tags: |
|
|
|
|
ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ github.sha }}-aarch64
|
|
|
|
|
|
|
|
publish_manifest:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [publish_x86, publish_aarch64]
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- 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
|
|
|
|
|
|
|
|
- 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 }}
|
|
|
|
|