-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (36 loc) · 1.27 KB
/
build-and-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Build and deploy application
on:
push:
branches:
- fix-build
env:
IMAGE_TAG: latest-arm64
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to container registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Setup node.js
uses: actions/setup-node@v2
with:
node-version: '14.15.3'
- name: Install dependencies
run: npm install
- name: Build application
run: npm run build
# See: https://github.com/orgs/community/discussions/25768#discussioncomment-3249186
- name: Set lowercase image name env var
run: |
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
- name: Build and push image
run: |
docker buildx build --platform linux/arm64/v8 --target release -t "${{ secrets.REGISTRY }}/$IMAGE_NAME:$IMAGE_TAG" --push .
- name: Build and push dracula image
run: |
docker buildx build --platform linux/arm64/v8 --target release -t "${{ secrets.REGISTRY }}/$IMAGE_NAME-dracula:$IMAGE_TAG" --build-arg BOT_PHRASES_URL=${{ secrets.DRACULA_URL }}" --push .