-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (44 loc) · 1.31 KB
/
Copy pathmain.yml
File metadata and controls
61 lines (44 loc) · 1.31 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
name: CI
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: azure/docker-login@v1
with:
login-server: ghcr.io
username: ${{ secrets.ACTOR }}
password: ${{ secrets.TOKEN }}
- run: |
docker build -t ghcr.io/ant2br/expresssimple:latest -f Dockerfile .
docker tag ghcr.io/ant2br/expresssimple:latest ghcr.io/ant2br/expresssimple:${{ github.sha }}
- run: |
docker push ghcr.io/ant2br/expresssimple:latest
docker push ghcr.io/ant2br/expresssimple:${{ github.sha }}
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
steps:
- name: checkout
uses: actions/checkout@v2
- name: kustomize
uses: imranismail/setup-kustomize@v1
with:
kustomize-version: v3.6.1
- name: update k8s
run: |
cd k8s
kustomize edit set image ghcr.io/ant2br/expresssimple:${{ github.sha }}
- name: commit
run: |
git config --local user.email "gitops@brener.dev"
git config --local user.name "GitOps"
git commit -am "Update image to ${{ github.sha }}"
- name: push
uses: ad-m/github-push-action@master