Merge branch 'master' into development #72
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: Build and Deploy to Development | |
on: | |
push: | |
branches: [development] | |
jobs: | |
build-docker-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout master | |
uses: actions/checkout@v2 | |
with: | |
ref: "development" | |
- name: Log in to container registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push image | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository }}:${{ github.sha }} | |
ghcr.io/${{ github.repository }}:development | |
deploy-docker-image: | |
needs: build-docker-image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Initialize doctl | |
uses: digitalocean/action-doctl@v2 | |
with: | |
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | |
- name: Log into K8s cluster | |
run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 tcs | |
- name: Deploy image to cluster | |
run: kubectl set image deployment/devapi devapi=ghcr.io/${{ github.repository }}:${{ github.sha }} --record -n dev-zab-web-stack | |
- name: Verify deployment | |
run: kubectl rollout status deployment/devapi -n dev-zab-web-stack |