Skip to content

Commit

Permalink
Use matrix for image builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarvl committed Feb 21, 2024
1 parent 8562cfe commit 629785e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ on:

jobs:
build-and-deploy:
strategy:
matrix:
bot-phrases-file: [default.js, dracula.js]
include:
- bot-phrases-file: default.js
image-suffix: ""
- bot-phrases-file: dracula.js
image-suffix: -dracula
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -34,7 +42,9 @@ jobs:
context: .
platforms: linux/amd64,linux/arm64/v8
push: true
tags: ${{ secrets.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
tags: ${{ secrets.REGISTRY }}/${{ env.IMAGE_NAME }}${{ matrix.image-suffix }}:latest
build-args: |
BOT_PHRASES_URL="https://static.glob.casa/basic-chess-ai/bot-phrases/${{ matrix.bot-phrases-file }}"
# - name: Build and push image
# run: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ RUN npm run build
FROM nginx:stable-alpine
ARG BOT_PHRASES_URL=""
COPY --from=builder /app/public /usr/share/nginx/html
RUN test -n "$BOT_PHRASES_URL" && curl -o /usr/share/nginx/html/js/botPhrases.js "$BOT_PHRASES_URL"
RUN curl -o /usr/share/nginx/html/js/botPhrases.js "$BOT_PHRASES_URL"

0 comments on commit 629785e

Please sign in to comment.