Skip to content

Commit

Permalink
Build multiarch image
Browse files Browse the repository at this point in the history
  • Loading branch information
darthmaim authored Jan 11, 2024
1 parent 40c37b9 commit a1cb85a
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ on:
# Run tests for any PRs.
pull_request:

env:
IMAGE_NAME: icons

jobs:
# Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
Expand Down Expand Up @@ -45,16 +42,15 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin

- name: Push image
- name: Generate image name
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/icons
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
Expand All @@ -71,5 +67,14 @@ jobs:
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
echo "IMAGE_NAME=$IMAGE_ID:$VERSION" >> $GITHUB_ENV
- name: Build image
run: |
docker buildx build \
--file Dockerfile \
--tag $IMAGE_NAME \
--platform=linux/amd64,linux/arm64 \
--output=type=image,push=true \
.

0 comments on commit a1cb85a

Please sign in to comment.