Merge pull request #2031 from serlo/oHCLt-kulla-2025-11-21-13-10 #1171
This file contains hidden or 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: Deploy | |
| on: | |
| push: | |
| branches: | |
| - production | |
| - staging | |
| jobs: | |
| docker-image: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/setup-node | |
| - 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@v3 | |
| with: | |
| credentials_json: '${{ secrets.GCP_PRODUCTION_SERVICE_ACCOUNT }}' | |
| - if: ${{ github.ref_name == 'staging' }} | |
| uses: google-github-actions/auth@v3 | |
| with: | |
| credentials_json: '${{ secrets.GCP_STAGING_SERVICE_ACCOUNT }}' | |
| - uses: google-github-actions/get-gke-credentials@v3 | |
| 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 |