feat: add suggestions #18
Workflow file for this run
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: Production Build Workflow | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set most recent tag | |
id: vars | |
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | |
- uses: docker/setup-buildx-action@v3 | |
name: Set up Docker Buildx | |
- uses: docker/login-action@v3 | |
name: Login to DockerHub | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- uses: docker/build-push-action@v6 | |
name: Build and Push WebApp Image | |
id: docker_build | |
with: | |
context: . | |
push: true | |
tags: orgsinfo/webapp:${{ steps.vars.outputs.tag }} | |
file: Dockerfile.production | |
- name: WebApp Image Digest | |
run: echo ${{ steps.docker_build.outputs.digest }} | |
deploy: | |
needs: docker | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set most recent tag | |
id: vars | |
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | |
- name: Deploy the app to the cluster | |
uses: nickgronow/kubectl@master | |
with: | |
config_data: ${{ secrets.KUBE_CONFIG_DATA }} | |
args: set image deployment/webapp-production webapp-prod-app=orgsinfo/webapp:${{ steps.vars.outputs.tag }} --namespace=production | |
- name: Verify deployment | |
uses: nickgronow/kubectl@master | |
with: | |
config_data: ${{ secrets.KUBE_CONFIG_DATA }} | |
args: rollout status deployment/webapp-production --namespace=production |