Skip to content

Merge pull request #104 from sinfo/staging #4

Merge pull request #104 from sinfo/staging

Merge pull request #104 from sinfo/staging #4

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/build-push-action@v2.7.0
name: Build and Push the Docker Image
id: docker_build
with:
push: true
tags: orgsinfo/corlief-frontend:${{ 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/corlief-frontend-production corlief-frontend-prod-app=orgsinfo/corlief-frontend:${{ steps.vars.outputs.tag }} --namespace=production
- name: Verify deployment
uses: nickgronow/kubectl@master
with:
config_data: ${{ secrets.KUBE_CONFIG_DATA }}
args: rollout status deployment/corlief-frontend-production --namespace=production