Skip to content

deploy - staging

deploy - staging #48

Workflow file for this run

name: deploy - staging
on:
workflow_dispatch:
release:
types:
- prereleased
jobs:
build:
uses: ./.github/workflows/build-images.yml
secrets: inherit
deploy:
runs-on: ubuntu-latest
environment: staging
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DO_REGISTRY_KEY }}
- name: Save DigitalOcean kubeconfig
run: doctl kubernetes cluster kubeconfig save ${{ vars.CLUSTER_NAME }}
- name: Update kustomization
run: |
cd k8s/overlays/staging
kustomize edit set image api=${{ secrets.DO_REGISTRY }}/${{ vars.API_IMAGE }}:${{ needs.build.outputs.image_tag }}
kustomize edit set image queue=${{ secrets.DO_REGISTRY }}/${{ vars.QUEUE_IMAGE }}:${{ needs.build.outputs.image_tag }}
kustomize edit set image ui=${{ secrets.DO_REGISTRY }}/${{ vars.UI_IMAGE }}:${{ needs.build.outputs.image_tag }}
- name: Deploy to staging
run: |
kubectl apply -k k8s/overlays/staging
kubectl rollout status deployment/farmhand-api-staging -n staging --timeout=2m