Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: docker multi arch images #13

Merged
merged 2 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 12 additions & 5 deletions .github/workflows/create-pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,24 @@ jobs:
with:
ref: "dev"

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build and Publish Docker Image @:next
run: |
# copose image ID and change all uppercase to lowercase
IMAGE_ID=ghcr.io/${{ github.repository }}
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')

# build docker image
docker build . --file Dockerfile --tag $IMAGE_ID:next

# log into docker registry
echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

# push images
docker push $IMAGE_ID:next
# build docker images and push to registry
docker buildx build . \
--file Dockerfile \
--tag $IMAGE_ID:next \
--platform linux/amd64,linux/arm64 \
--push
21 changes: 14 additions & 7 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ jobs:
repo: context.repo.repo,
title: 'next'
});

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build and Publish Docker Image @:latest and @:v_._._
run: |
Expand All @@ -100,12 +106,13 @@ jobs:
VERSION=${{ steps.changelog.outputs.tag }}
VERSION=$(echo $VERSION | sed -e 's/^v//')

# build docker image
docker build . --file Dockerfile --tag $IMAGE_ID:latest --tag $IMAGE_ID:$VERSION

# log into docker registry
echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

# push images
docker push $IMAGE_ID:latest
docker push $IMAGE_ID:$VERSION

# build docker image and push to registry
docker buildx build . \
--file Dockerfile \
--tag $IMAGE_ID:latest \
--tag $IMAGE_ID:$VERSION \
--platform linux/amd64,linux/arm64 \
--push