Merge pull request #447 from sinfo/staging #43
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@v2 | |
- name: Set most recent tag | |
id: vars | |
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | |
- uses: docker/login-action@v1 | |
name: Login to DockerHub | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- uses: docker/[email protected] | |
name: Build and Push the Docker Image | |
id: docker_build | |
with: | |
push: true | |
tags: orgsinfo/webapp:${{ steps.vars.outputs.tag }} | |
- name: Docker Image Digest | |
run: echo ${{ steps.docker_build.outputs.digest }} | |
deploy: | |
needs: docker | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- 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 |