Skip to content

feat: build multi arch #58

feat: build multi arch

feat: build multi arch #58

name: Build PR Image
on:
pull_request:
jobs:
build-image:
name: build image
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Get Current Date
id: get_date
run: echo "::set-output name=now::$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64, linux/arm64
tags: afrima/anki-sync-server:24.11-rc, afrima/anki-sync-server:latest-rc
build-args: |
NOW=${{ steps.get_date.outputs.now }}
- name: Wait for healthchecks
run: docker run -e SYNC_USER1=test_user_name:test_user_password -d afrima/anki-sync-server:latest-rc | timeout 60s sh -c 'until docker ps | grep afrima/anki-sync-server:latest-rc | grep -q healthy; do echo "Waiting for container to be healthy..."; sleep 2; done'
- name: push image
run: docker push afrima/anki-sync-server --all-tags
approve:
name: approve
runs-on: ubuntu-24.04
needs: [ build-image ]
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.user.login == 'renovate[bot]' }}
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Approve PR
run: gh pr review ${{ github.event.number }} -a
merge:
name: merge
runs-on: ubuntu-24.04
needs: [ approve ]
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.user.login == 'renovate[bot]' }}
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: merge PR
run: gh pr merge ${{ github.event.number }} -a