-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.23 KB
/
build.yaml
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
46
47
48
49
50
51
name: Build
env:
IMAGE_TAG_CLIENT: ghcr.io/werify-eu/werify_client/werify_client
IMAGE_VERSION: ${{ github.ref == 'refs/heads/main' && 'latest' || 'staging' }}
on:
push:
branches:
- main
- develop
jobs:
build_werify_client:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'yarn'
- name: Docker Buildx Install
uses: docker/setup-buildx-action@v3
- name: Yarn install app
run: yarn install
- name: Yarn build app
run: yarn run build
- name: Docker build image
uses: docker/build-push-action@v5
with:
context: .
target: production
push: true
tags: ${{env.IMAGE_TAG_CLIENT}}:${{env.IMAGE_VERSION}}
cache-from: type=gha
cache-to: type=gha,mode=max