-
Notifications
You must be signed in to change notification settings - Fork 4
38 lines (37 loc) · 1.21 KB
/
deploy.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
name: Deploy
on:
push:
branches:
- production
- staging
jobs:
docker-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: serlo/configure-repositories/actions/setup-node@main
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: yarn deploy:images:${{ github.ref_name }}
deploy-image:
runs-on: ubuntu-latest
needs: docker-image
steps:
- if: ${{ github.ref_name == 'production' }}
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_PRODUCTION_SERVICE_ACCOUNT }}'
- if: ${{ github.ref_name == 'staging' }}
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_STAGING_SERVICE_ACCOUNT }}'
- uses: google-github-actions/get-gke-credentials@v2
with:
cluster_name: serlo-${{ github.ref_name }}-cluster
location: europe-west3-a
- run: kubectl delete pod -n api -l app=server
- run: kubectl delete pod -n api -l app=swr-queue-worker