-
Notifications
You must be signed in to change notification settings - Fork 6
40 lines (30 loc) · 1.29 KB
/
manual.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Manual production deploy
on:
workflow_dispatch:
jobs:
front-prod-deploy:
name: prod-deploy
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
- name: Extract branch name
shell: bash
run: echo "name=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
id: extract_branch
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN_PROD }}
- name: Save DigitalOcean kubeconfig with short-lived credentials
run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 ${{ secrets.K8S_PROD }}
- name: Update deploy file
run: TAG=${{ env.name }}-$(echo $GITHUB_SHA | head -c7) && sed -i 's|<IMAGE>|dappforce/subid-frontend:'${TAG}'|' $GITHUB_WORKSPACE/deployment/production/deploy.yaml
- name: Remove hpa
run: kubectl -n sub-id delete hpa subid-front
- name: Deploy to DigitalOcean Kubernetes
run: kubectl apply -f $GITHUB_WORKSPACE/deployment/production/deploy.yaml
- name: Verify deployment
run: kubectl -n sub-id rollout status deployment/subid-front
- name: Recreate hpa
run: kubectl -n sub-id create -f $GITHUB_WORKSPACE/deployment/hpa/hpa.yaml