ci: pass docker arg
This commit is contained in:
parent
eb1a1981ab
commit
793b3e63dd
2 changed files with 9 additions and 5 deletions
6
.github/workflows/push.yml
vendored
6
.github/workflows/push.yml
vendored
|
|
@ -53,14 +53,12 @@ jobs:
|
||||||
else
|
else
|
||||||
echo "tags=avoylenko/wwebjs-api:${{ github.ref_name }},avoylenko/wwebjs-api:latest" >> $GITHUB_OUTPUT
|
echo "tags=avoylenko/wwebjs-api:${{ github.ref_name }},avoylenko/wwebjs-api:latest" >> $GITHUB_OUTPUT
|
||||||
fi
|
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
|
- name: Build and push with dynamic tag
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
build-args: |
|
||||||
|
USE_EDGE=${{ github.ref_name == 'edge' }}
|
||||||
no-cache: ${{ github.ref_name == 'edge' }}
|
no-cache: ${{ github.ref_name == 'edge' }}
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,15 @@ WORKDIR /usr/src/app
|
||||||
|
|
||||||
FROM base AS deps
|
FROM base AS deps
|
||||||
|
|
||||||
|
ARG USE_EDGE=false
|
||||||
|
|
||||||
COPY package*.json ./
|
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
|
# Create the final stage
|
||||||
FROM base
|
FROM base
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue