-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) 路 1.26 KB
/
Copy pathcd.yaml
File metadata and controls
47 lines (39 loc) 路 1.26 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
name: CD Gitops
on:
push:
branches:
- main
jobs:
build_and_push:
name: Build & Push image to Dockerhub
runs-on: ubuntu-latest
steps:
- name: Checkout Github
uses: actions/checkout@v3
- name: Build & Push image to Dockerhub
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: ${{ secrets.DOCKER_USERNAME }}/gitops-go
tags: ${{ github.sha }}, latest
- name: Setup Kustomize
uses: imranismail/setup-kustomize@v1
with:
kustomize-version: "3.6.1"
- name: Update k8s resources
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: |
cd k8s
kustomize edit set image gitops-go=${DOCKER_USERNAME}/gitops-go:$GITHUB_SHA
- name: Commit
run: |
git config --local user.email "action@github.com"
git config --local user.name "Github Action"
git commit -am "Bump Docker Version"
- name: Push version to Github
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.TOKEN_GITHUB }}
repository: kevencript/gitops-argocd-poc