Skip to content

Merge pull request #448 from sinfo/staging #44

Merge pull request #448 from sinfo/staging

Merge pull request #448 from sinfo/staging #44

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