Update README.md #299
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: Deploy to gcp | |
on: | |
push: | |
branches: [ master ] | |
env: | |
IMAGE: ghcr.io/${{ github.repository }}:${{ github.sha }} | |
jobs: | |
build: | |
name: Build and push docker conatainer | |
runs-on: ubuntu-latest | |
environment: production | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
- uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: ${{ env.IMAGE }} | |
deploy-dev: | |
name: Deploy to dev-gcp | |
needs: build | |
environment: production | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
- name: Generate nais variables | |
run: | | |
cat > .nais/vars.yaml <<EOF | |
SITEIMPROVE: ${{ secrets.SITEIMPROVE }} | |
UMAMI: ${{ secrets.UMAMI }} | |
AMPLITUDE_100000009: ${{ secrets.AMPLITUDE_100000009 }} | |
AMPLITUDE_100000264: ${{ secrets.AMPLITUDE_100000264 }} | |
AMPLITUDE_100000243: ${{ secrets.AMPLITUDE_100000243 }} | |
AMPLITUDE_100000244: ${{ secrets.AMPLITUDE_100000244 }} | |
AMPLITUDE_100002286: ${{ secrets.AMPLITUDE_100002286 }} | |
AMPLITUDE_100003868: ${{ secrets.AMPLITUDE_100003868 }} | |
AMPLITUDE_100003867: ${{ secrets.AMPLITUDE_100003867 }} | |
AMPLITUDE_100002016: ${{ secrets.AMPLITUDE_100002016 }} | |
AMPLITUDE_100005528: ${{ secrets.AMPLITUDE_100005528 }} | |
AMPLITUDE_100002233: ${{ secrets.AMPLITUDE_100002233 }} | |
AMPLITUDE_100001607: ${{ secrets.AMPLITUDE_100001607 }} | |
AMPLITUDE_100002226: ${{ secrets.AMPLITUDE_100002226 }} | |
AMPLITUDE_100004122: ${{ secrets.AMPLITUDE_100004122 }} | |
AMPLITUDE_100005544: ${{ secrets.AMPLITUDE_100005544 }} | |
AMPLITUDE_100000251: ${{ secrets.AMPLITUDE_100000251 }} | |
AMPLITUDE_100000965: ${{ secrets.AMPLITUDE_100000965 }} | |
AMPLITUDE_100002261: ${{ secrets.AMPLITUDE_100002261 }} | |
AMPLITUDE_100002287: ${{ secrets.AMPLITUDE_100002287}} | |
AMPLITUDE_100004171: ${{ secrets.AMPLITUDE_100004171}} | |
AMPLITUDE_100006162: ${{ secrets.AMPLITUDE_100006162 }} | |
REOPS: ${{ secrets.REOPS }} | |
EOF | |
- name: Deploy to prod | |
uses: nais/deploy/actions/deploy@v2 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: dev-gcp | |
RESOURCE: .nais/dev-gcp.yaml | |
VAR: image=${{ env.IMAGE }} | |
VARS: .nais/vars.yaml | |
deploy-prod: | |
name: Deploy to prod-gcp | |
needs: deploy-dev | |
environment: production | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
- name: Generate nais variables | |
run: | | |
cat > .nais/vars.yaml <<EOF | |
SITEIMPROVE: ${{ secrets.SITEIMPROVE }} | |
UMAMI: ${{ secrets.UMAMI }} | |
AMPLITUDE_100000009: ${{ secrets.AMPLITUDE_100000009 }} | |
AMPLITUDE_100000264: ${{ secrets.AMPLITUDE_100000264 }} | |
AMPLITUDE_100000243: ${{ secrets.AMPLITUDE_100000243 }} | |
AMPLITUDE_100000244: ${{ secrets.AMPLITUDE_100000244 }} | |
AMPLITUDE_100002286: ${{ secrets.AMPLITUDE_100002286 }} | |
AMPLITUDE_100003868: ${{ secrets.AMPLITUDE_100003868 }} | |
AMPLITUDE_100003867: ${{ secrets.AMPLITUDE_100003867 }} | |
AMPLITUDE_100002016: ${{ secrets.AMPLITUDE_100002016 }} | |
AMPLITUDE_100005528: ${{ secrets.AMPLITUDE_100005528 }} | |
AMPLITUDE_100002233: ${{ secrets.AMPLITUDE_100002233 }} | |
AMPLITUDE_100001607: ${{ secrets.AMPLITUDE_100001607 }} | |
AMPLITUDE_100002226: ${{ secrets.AMPLITUDE_100002226 }} | |
AMPLITUDE_100004122: ${{ secrets.AMPLITUDE_100004122 }} | |
AMPLITUDE_100005544: ${{ secrets.AMPLITUDE_100005544 }} | |
AMPLITUDE_100000251: ${{ secrets.AMPLITUDE_100000251 }} | |
AMPLITUDE_100000965: ${{ secrets.AMPLITUDE_100000965 }} | |
AMPLITUDE_100002261: ${{ secrets.AMPLITUDE_100002261 }} | |
AMPLITUDE_100002287: ${{ secrets.AMPLITUDE_100002287}} | |
AMPLITUDE_100004171: ${{ secrets.AMPLITUDE_100004171 }} | |
AMPLITUDE_100006162: ${{ secrets.AMPLITUDE_100006162 }} | |
REOPS: ${{ secrets.REOPS }} | |
EOF | |
- name: Deploy to prod | |
uses: nais/deploy/actions/deploy@v2 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: prod-gcp | |
RESOURCE: .nais/prod-gcp.yaml | |
VAR: image=${{ env.IMAGE }} | |
VARS: .nais/vars.yaml |