-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (63 loc) · 2.14 KB
/
build.yml
File metadata and controls
73 lines (63 loc) · 2.14 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Publish container images to GHCR
on:
workflow_run:
workflows: ["Automated version release Schedule"]
types:
- completed
env:
IMAGE_NAME: ${{ github.repository }}
jobs:
PushBuildImageGHCR:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code repository
id: code_checkout
uses: actions/checkout@v4
- name: Log in Github Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract short commit SHA
id: extract_sha
run: echo "SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV
- name: Get the latest tag
id: latest_tag
uses: JinoArch/get-latest-tag@latest
- name: Build and push Docker main image
id: build_push_main_service
uses: docker/build-push-action@v3
with:
context: .
push: true
file: Dockerfile.main
tags: |
ghcr.io/extinctcoder/tms_micro:main
ghcr.io/extinctcoder/tms_micro:main-${{ env.SHORT_SHA }}
ghcr.io/extinctcoder/tms_micro:main-${{ steps.latest_tag.outputs.latestTag }}
- name: Build and push Docker auth image
id: build_push_auth_service
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile.auth
push: true
tags: |
ghcr.io/extinctcoder/tms_micro:auth
ghcr.io/extinctcoder/tms_micro:auth-${{ env.SHORT_SHA }}
ghcr.io/extinctcoder/tms_micro:auth-${{ steps.latest_tag.outputs.latestTag }}
- name: Build and push Docker user image
id: build_push_user_service
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile.user
push: true
tags: |
ghcr.io/extinctcoder/tms_micro:user
ghcr.io/extinctcoder/tms_micro:user-${{ env.SHORT_SHA }}
ghcr.io/extinctcoder/tms_micro:user-${{ steps.latest_tag.outputs.latestTag }}