Skip to content

Commit

Permalink
feat(bot): support image build for amd64
Browse files Browse the repository at this point in the history
  • Loading branch information
yurisasc committed Jan 30, 2024
1 parent f43e257 commit 698cd27
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/publish-discord-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ on:
paths:
- "discord-bot/**"
workflow_dispatch:

jobs:
build-and-publish:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
arch: [arm64]
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Re-register commands
working-directory: ./discord-bot
env:
Expand All @@ -25,24 +23,29 @@ jobs:
npm install
npm run commands:clear
npm run commands:register
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: ${{ matrix.arch }}
platforms: all

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

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: ./discord-bot
push: true
platforms: linux/arm64
platforms: linux/amd64,linux/arm64
tags: ${{ secrets.DOCKERHUB_USERNAME }}/palworld-discord-bot:latest

- name: Logout of Docker Hub
run: |
docker logout
3 changes: 1 addition & 2 deletions discord-bot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Using ARM64 so it can run on Raspberry Pi
FROM arm64v8/node:16
FROM node:16

# Create app directory
WORKDIR /app
Expand Down

0 comments on commit 698cd27

Please sign in to comment.