Skip to content

CD

CD #7

Workflow file for this run

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 '[email protected]'
git add values.yaml
git commit -m "Update values.yaml"
git push