Fix helm chart #9
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: Go App CI/CD | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.23' # Make sure this matches your go.mod file | |
- name: Run tests | |
run: go test -v ./... | |
build-and-push: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build Docker image | |
run: | | |
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/devops-journey:latest . | |
- name: Push Docker image | |
run: | | |
docker push ${{ secrets.DOCKERHUB_USERNAME }}/devops-journey:latest | |
- name: Set up Helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: v3.12.0 # Specify the Helm version you want to use | |
- name: Package Helm chart | |
run: | | |
helm package ./helm-chart | |
- name: Upload Helm chart as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: helm-chart | |
path: devops-journey-*.tgz |