-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (44 loc) · 1.35 KB
/
deploy.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
name: cd
on:
push:
branches:
- "master"
jobs:
build:
runs-on: ubuntu-latest
steps:
# checkout
- uses: actions/checkout@v4
# docker
- uses: docker/#-action@v2
with:
registry: harbor.kigawa.net
username: "robot$portfolio"
password: ${{ secrets.HARBOR_PASS }}
- name: BuildAndPushImageOnHarbor
env:
PORT: 80
SERVER_NAME: portfolio.kigawa.net
run: |
docker build -t harbor.kigawa.net/private/portfolio:${{ github.ref_name }}-${{ github.run_number }} \
-f Dockerfile \
./
docker push harbor.kigawa.net/private/portfolio:${{ github.ref_name }}-${{ github.run_number }}
# argo
- name: checkout manifest repository
uses: actions/checkout@v3
with:
repository: kigawa01/k8s
ref: main
token: ${{ secrets.GIT_TOKEN }}
- name: Update YAML File
run: |
yq -i '.spec.template.spec.containers[0].image = "harbor.kigawa.net/private/portfolio:${{ github.ref_name }}-${{ github.run_number }}"' \
./portfolio/portfolio.yml
- name: push
run: |
git config user.name githubActions
git config user.email bot@kigawa.net
git add .
git commit --author=. -m "update rev"
git push