From 629785e8b2f2256143cb90eac999f7a5377583ee Mon Sep 17 00:00:00 2001 From: Andrew Jarvis Date: Wed, 21 Feb 2024 01:30:11 -0500 Subject: [PATCH] Use matrix for image builds --- .github/workflows/build-and-deploy.yml | 12 +++++++++++- Dockerfile | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 6135432..cf6b6ee 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -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 @@ -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: | diff --git a/Dockerfile b/Dockerfile index 88ead1a..e11b94c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"