Skip to content

Commit

Permalink
fix(.github): correctly use docker multi-platform build (#404)
Browse files Browse the repository at this point in the history
  • Loading branch information
CarelessInternet authored Nov 5, 2024
1 parent 3f8f771 commit 5a82e78
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/push_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ jobs:
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up QEMU.
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx.
uses: docker/setup-buildx-action@v3
- uses: actions/checkout@v4
- name: Log in to the GitHub Container Registry.
uses: docker/login-action@v3
with:
Expand All @@ -30,10 +35,15 @@ jobs:
run: |
RELEASE_VERSION=${GITHUB_REF#refs/*/v}
IMAGE_REPOSITORY_BOT=${RAW_IMAGE_REPOSITORY@L}-bot
echo "FULL_IMAGE_URL_BOT=${REGISTRY}/$IMAGE_REPOSITORY_BOT:$RELEASE_VERSION" >> ${GITHUB_ENV}
IMAGE_URL_BOT=${REGISTRY}/$IMAGE_REPOSITORY_BOT
echo "FULL_IMAGE_URL_BOT_LATEST=$IMAGE_URL_BOT:latest" >> ${GITHUB_ENV}
echo "FULL_IMAGE_URL_BOT_VERSION=$IMAGE_URL_BOT:$RELEASE_VERSION" >> ${GITHUB_ENV}
- name: Build and push the bot image.
env:
DOCKERFILE_ROUTE: ./apps/bot/Dockerfile
run: |
docker build --file ${{ env.DOCKERFILE_ROUTE }} . --no-cache --platform linux/amd64,linux/arm64 --tag ${{ env.FULL_IMAGE_URL_BOT }}
docker push ${{ env.FULL_IMAGE_URL_BOT }}
uses: docker/build-push-action@v6
with:
file: ./apps/bot/Dockerfile
context: .
no-cache: true
platforms: linux/amd64,linux/arm64
tags: ${{ env.FULL_IMAGE_URL_BOT_LATEST }}, ${{ env.FULL_IMAGE_URL_BOT_VERSION }}
push: true
4 changes: 2 additions & 2 deletions apps/website/src/app/[locale]/docs/self-hosting/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ services:
bot:
container_name: ticketer-bot
# You can change to any available version such as "3.2.1".
image: ghcr.io/carelessinternet/ticketer-bot:3.2.1
# You can change "latest" to any available version such as "3.2.2".
image: ghcr.io/carelessinternet/ticketer-bot:3.2.2
# Change the platform to the one on your linux environment (amd64, arm64).
platform: linux/arm64
restart: unless-stopped
Expand Down

0 comments on commit 5a82e78

Please sign in to comment.