-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (34 loc) · 1012 Bytes
/
build.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
name: Build
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
env:
CONTAINER_REGISTRY: ghcr.io
steps:
- uses: actions/checkout@v4
- name: Build app
run: |
cd app
yarn install --immutable
yarn tsc
yarn build:backend --config ../../app-config.yaml --config ../../app-config.production.yaml
- name: Get Docker image tag
id: image_tags
run: |
echo "tag=$CONTAINER_REGISTRY/$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]'):$GITHUB_SHA" >> $GITHUB_OUTPUT
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.CONTAINER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker build
run: |
cd app && docker build . --tag
docker push $TAG
env:
TAG: ${{ steps.image_tags.outputs.tag }}