Skip to content

Commit

Permalink
🚀 build for arm64 instead of amd64 since cornelius is an ARM server
Browse files Browse the repository at this point in the history
  • Loading branch information
M4GNV5 committed Jul 1, 2024
1 parent 38bf687 commit a652698
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,37 @@ env:
IMAGE_REPO: ${{ github.repository }}

jobs:
docker:
build-and-push-docker:
runs-on: ubuntu-latest
name: Build docker image and push to GCR
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Container Registry
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
run: |
docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_REPO }} .;
docker image push ${{ env.REGISTRY }}/${{ env.IMAGE_REPO }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_REPO }}:latest
platforms: linux/arm64/v8
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

0 comments on commit a652698

Please sign in to comment.