-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.55 KB
/
docker-release.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Release Run
on:
release:
types: [published]
jobs:
build:
name: Build Docker Images
runs-on: ubuntu-latest
steps:
- name: downcase REPO
id: lowercase
run: |
echo "REPO=${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@v4
- name: Get Version Tag
id: version
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> "$GITHUB_OUTPUT"
- name: Docker Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node 20.x
uses: actions/setup-node@v4
with:
node-version: 20.12.2
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install Angular CLI
run: npm install -g @angular/cli
- name: Build & push frontend
uses: docker/build-push-action@v5
with:
context: ./frontend
file: ./frontend/Dockerfile.prod
push: true
tags: |
ghcr.io/${{ steps.lowercase.outputs.REPO }}/frontend:latest
ghcr.io/${{ steps.lowercase.outputs.REPO }}/frontend:${{ steps.version.outputs.VERSION }}
- name: Build & push backend
uses: docker/build-push-action@v5
with:
context: ./backend
file: ./backend/Dockerfile
push: true
tags: |
ghcr.io/${{ steps.lowercase.outputs.REPO }}/backend:latest
ghcr.io/${{ steps.lowercase.outputs.REPO }}/backend:${{ steps.version.outputs.VERSION }}