-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (98 loc) · 3.1 KB
/
release.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Release
on:
push:
branches:
- "main"
env:
REGISTRY: ghcr.io
jobs:
test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Test
run: go test -v ./...
push:
name: Push
runs-on: ubuntu-latest
needs: test
steps:
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
name: Check out code
- name: Construct profile-server metadata
id: profile-server-meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/TheLab-ms/profile
tags: |
type=sha
- name: Push profile-server image
uses: docker/build-push-action@v5
with:
push: true
file: ./cmd/profile-server/Dockerfile
tags: ${{ steps.profile-server-meta.outputs.tags }}
labels: ${{ steps.profile-server-meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Construct visit-check-job metadata
id: visit-check-job-meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/TheLab-ms/profile/visit-check-job
tags: |
type=sha
- name: Push visit-check-job image
uses: docker/build-push-action@v5
with:
push: true
file: ./cmd/visit-check-job/Dockerfile
tags: ${{ steps.visit-check-job-meta.outputs.tags }}
labels: ${{ steps.visit-check-job-meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Construct paypal-check-job metadata
id: paypal-check-job-meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/TheLab-ms/profile/paypal-check-job
tags: |
type=sha
- name: Push paypal-check-job image
uses: docker/build-push-action@v5
with:
push: true
file: ./cmd/paypal-check-job/Dockerfile
tags: ${{ steps.paypal-check-job-meta.outputs.tags }}
labels: ${{ steps.paypal-check-job-meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Construct profile-async metadata
id: profile-async-meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/TheLab-ms/profile/profile-async
tags: |
type=sha
- name: Push profile-async image
uses: docker/build-push-action@v5
with:
push: true
file: ./cmd/profile-async/Dockerfile
tags: ${{ steps.profile-async-meta.outputs.tags }}
labels: ${{ steps.profile-async-meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max