-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (31 loc) · 1.05 KB
/
cd.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
name: CD
on: workflow_dispatch
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKERHUB_PASSWORD }}
- name: Build Docker image
run: |
cd app
docker build -t ${{ env.DOCKERHUB_USERNAME }}/app:${{ github.sha }} .
- name: Push Docker image
run: docker push ${{ env.DOCKERHUB_USERNAME }}/app:${{ github.sha }}
- name: Update values.yaml
run: |
cd helm
sed -i 's|APP_VERSION:.*|APP_VERSION: '${{ github.sha }}'|' values.yaml
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
git add values.yaml
git commit -m "Update values.yaml"
git push