Skip to content

Commit 793b3e6

Browse files
committed
ci: pass docker arg
1 parent eb1a198 commit 793b3e6

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/push.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,12 @@ jobs:
5353
else
5454
echo "tags=avoylenko/wwebjs-api:${{ github.ref_name }},avoylenko/wwebjs-api:latest" >> $GITHUB_OUTPUT
5555
fi
56-
- name: Install edge version of whatsapp-web.js
57-
if: github.ref_name == 'edge'
58-
run: |
59-
npm install --save-exact github:pedroslopez/whatsapp-web.js#main
6056
- name: Build and push with dynamic tag
6157
uses: docker/build-push-action@v5
6258
with:
6359
platforms: linux/amd64,linux/arm64,linux/arm/v7
6460
push: true
6561
tags: ${{ steps.meta.outputs.tags }}
62+
build-args: |
63+
USE_EDGE=${{ github.ref_name == 'edge' }}
6664
no-cache: ${{ github.ref_name == 'edge' }}

Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@ WORKDIR /usr/src/app
99

1010
FROM base AS deps
1111

12+
ARG USE_EDGE=false
13+
1214
COPY package*.json ./
1315

14-
RUN npm ci --only=production --ignore-scripts
16+
RUN if [ "$USE_EDGE" = "true" ]; then \
17+
npm install --save-exact --omit=dev --ignore-scripts github:pedroslopez/whatsapp-web.js#main; \
18+
else \
19+
npm ci --only=production --ignore-scripts; \
20+
fi
1521

1622
# Create the final stage
1723
FROM base

0 commit comments

Comments
 (0)