-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (124 loc) · 4.05 KB
/
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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Build for Release
on:
workflow_dispatch:
jobs:
admin:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Create Release Branch
run: |
git switch -c release-admin
git push --set-upstream -f origin release-admin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: piny940
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
push: true
context: ./admin
file: ./admin/Dockerfile
build-args: |
"BACKEND_HOST=http://portfolio-backend.default.svc.cluster.local:8080"
tags: |
ghcr.io/piny940/portfolio-admin:1.0.${{ github.run_number }}
ghcr.io/piny940/portfolio-admin:latest
app:
runs-on: ubuntu-latest
steps:
- name: Get current datetime
run: echo "TIMESTAMP=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
- name: Check out
uses: actions/checkout@v4
- name: Create Release Branch
run: |
git switch -c release-app
git push --set-upstream -f origin release-app
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: piny940
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
push: true
context: ./app
file: ./app/Dockerfile
build-args: |
BACKEND_HOST=https://portfolio-backend.piny940.com
tags: |
ghcr.io/piny940/portfolio-app:1.0.0-${{ env.TIMESTAMP }}
ghcr.io/piny940/portfolio-app:latest
backend:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Create Release Branch
run: |
git switch -c release-backend
git push --set-upstream -f origin release-backend
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: piny940
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
push: true
context: ./backend
file: ./backend/Dockerfile
tags: |
ghcr.io/piny940/portfolio-backend:1.0.${{ github.run_number }}
ghcr.io/piny940/portfolio-backend:latest
updater:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Create Release Branch
run: |
git switch -c release-updater
git push --set-upstream -f origin release-updater
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: piny940
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
push: true
context: ./updater
file: ./updater/Dockerfile
build-args: |
BACKEND_HOST=https://portfolio-backend.piny940.com
tags: |
ghcr.io/piny940/portfolio-updater:1.0.${{ github.run_number }}
ghcr.io/piny940/portfolio-updater:latest