Merge pull request #417 from sinfo/staging #19
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: | |
context: ./backend | |
push: true | |
tags: orgsinfo/deck2:${{ steps.vars.outputs.tag }} | |
file: ./backend/Dockerfile | |
- name: Docker Image Digest | |
run: echo ${{ steps.docker_build.outputs.digest }} | |
docker-frontend: | |
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 Deck2 Frontend Image | |
id: docker_build | |
with: | |
context: ./frontend | |
push: true | |
tags: orgsinfo/deck2-frontend:${{ steps.vars.outputs.tag }} | |
file: ./frontend/Dockerfile | |
- name: Deck2 Frontend 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/deck2-production deck2-prod-app=orgsinfo/deck2:${{ steps.vars.outputs.tag }} --namespace=production | |
- name: Verify deployment | |
uses: nickgronow/kubectl@master | |
with: | |
config_data: ${{ secrets.KUBE_CONFIG_DATA }} | |
args: rollout status deployment/deck2-production --namespace=production | |
deploy-frontend: | |
needs: docker-frontend | |
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 frontend app to the cluster | |
uses: nickgronow/kubectl@master | |
with: | |
config_data: ${{ secrets.KUBE_CONFIG_DATA }} | |
args: set image deployment/deck2-frontend-production deck2-frontend-prod-app=orgsinfo/deck2-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/deck2-frontend-production --namespace=production |