ci: pass docker arg

This commit is contained in:
Anton Voylenko 2025-12-09 22:03:50 +02:00
commit 793b3e63dd
2 changed files with 9 additions and 5 deletions

View file

@ -53,14 +53,12 @@ jobs:
else
echo "tags=avoylenko/wwebjs-api:${{ github.ref_name }},avoylenko/wwebjs-api:latest" >> $GITHUB_OUTPUT
fi
- name: Install edge version of whatsapp-web.js
if: github.ref_name == 'edge'
run: |
npm install --save-exact github:pedroslopez/whatsapp-web.js#main
- name: Build and push with dynamic tag
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
USE_EDGE=${{ github.ref_name == 'edge' }}
no-cache: ${{ github.ref_name == 'edge' }}

View file

@ -9,9 +9,15 @@ WORKDIR /usr/src/app
FROM base AS deps
ARG USE_EDGE=false
COPY package*.json ./
RUN npm ci --only=production --ignore-scripts
RUN if [ "$USE_EDGE" = "true" ]; then \
npm install --save-exact --omit=dev --ignore-scripts github:pedroslopez/whatsapp-web.js#main; \
else \
npm ci --only=production --ignore-scripts; \
fi
# Create the final stage
FROM base