Skip to content

Commit

Permalink
fix: Build main image on amd64
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Jan 14, 2024
1 parent 3d6e17e commit f9e915c
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 7 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/ghcr-arm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Create and publish a Docker image

on:
push:
branches:
- main
schedule:
- cron: "0 1 * * *"
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

# https://blog.thesparktree.com/docker-multi-arch-github-actions
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,arm'

- uses: docker/setup-buildx-action@3762d454f382a89982d79f33e1ff246835322c4d

- name: Log in to the Container registry
uses: docker/login-action@1f401f745bf57e30b3a2800ad308a87d2ebdf14b
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@62339db73c56dd749060f65a6ebb93a6e056b755
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@fdf7f43ecf7c1a5c7afe936410233728a8c2d9c2
with:
context: r-devel
platforms: linux/arm64
cache-from: ${{ ( github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' && 'type=gha' ) || '' }}
cache-to: type=gha,mode=max
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
7 changes: 0 additions & 7 deletions .github/workflows/ghcr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

# https://blog.thesparktree.com/docker-multi-arch-github-actions
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,arm'

- uses: docker/setup-buildx-action@3762d454f382a89982d79f33e1ff246835322c4d

- name: Log in to the Container registry
Expand All @@ -57,7 +51,6 @@ jobs:
uses: docker/build-push-action@fdf7f43ecf7c1a5c7afe936410233728a8c2d9c2
with:
context: r-devel
platforms: linux/arm64
cache-from: ${{ ( github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' && 'type=gha' ) || '' }}
cache-to: type=gha,mode=max
push: true
Expand Down

0 comments on commit f9e915c

Please sign in to comment.