-
Notifications
You must be signed in to change notification settings - Fork 3
37 lines (34 loc) · 903 Bytes
/
build-backend.yaml
File metadata and controls
37 lines (34 loc) · 903 Bytes
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
name: Backend Build
on:
workflow_dispatch: {}
push:
branches:
- main
paths:
- 'Backend/**'
- 'UI/**'
env:
IMAGE_NAME: ghcr.io/himidiri/mergex/backend
DOCKER_BUILDKIT: 1
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm --prefix=UI install
- run: npm --prefix=UI run build
- run: cp -avr UI/build Backend/
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: docker build -t $IMAGE_NAME:latest -f Backend/Dockerfile Backend/
- run: docker tag $IMAGE_NAME:latest $IMAGE_NAME:commit-${GITHUB_SHA:0:8}
- run: docker push $IMAGE_NAME --all-tags