main #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CD | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: build image and push to docker hub | |
uses: docker/build-push-action@v1.1.0 | |
with: | |
username: rampss | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
repository: rampss/argocd | |
tags: ${{ github.sha }}, latest | |
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 goapp=rampss/argocd:${{ github.sha }} | |
cat kustomization.yaml | |
- name: commit | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "Deploy Action" | |
git commit -am "change image tag" | |
- name: push | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.PERSONAL_TOKEN }} | |