Merge pull request #417 from sinfo/staging #111
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: Staging Build Workflow | |
on: | |
push: | |
branches: | |
- "staging" | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- 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 Deck2 Backend Image | |
id: docker_build | |
with: | |
context: ./backend | |
push: true | |
tags: orgsinfo/deck2:latest | |
file: ./backend/Dockerfile | |
- name: Deck2 Backend Image Digest | |
run: echo ${{ steps.docker_build.outputs.digest }} | |
docker-frontend: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- 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 Deck2 Frontend Image | |
id: docker_build | |
with: | |
context: ./frontend | |
push: true | |
tags: orgsinfo/deck2-frontend:latest | |
file: ./frontend/Dockerfile_staging | |
- 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: Deploy the backend to the cluster | |
uses: nickgronow/kubectl@master | |
with: | |
config_data: ${{ secrets.KUBE_CONFIG_DATA }} | |
args: delete pod --selector="app=deck2-staging-app" --namespace=staging | |
deploy-frontend: | |
needs: docker-frontend | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Deploy the frontend to the cluster | |
uses: nickgronow/kubectl@master | |
with: | |
config_data: ${{ secrets.KUBE_CONFIG_DATA }} | |
args: delete pod --selector="app=deck2-frontend-staging-app" --namespace=staging | |