Skip to content

Instantly share code, notes, and snippets.

@ccfiel
Last active September 12, 2023 07:40
Show Gist options
  • Save ccfiel/8dd8d094bdec2857373d27d068201774 to your computer and use it in GitHub Desktop.
Save ccfiel/8dd8d094bdec2857373d27d068201774 to your computer and use it in GitHub Desktop.
northflank
name: KaHero GraphQL Server Production
run-name: ${{ github.actor }} is building KaHero GraphQL Server Production 🚀
on:
push:
branches:
- main
jobs:
Build-Production-GraphQL-Server:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- run: npm ci
- run: tsc --version
- run: npm run build
- name: install the gcloud cli
uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ secrets.GOOGLE_PROJECT }}
service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
export_default_credentials: true
- name: build and push the docker image
env:
GOOGLE_PROJECT: ${{ secrets.GOOGLE_PROJECT }}
run: |
gcloud auth configure-docker asia-southeast1-docker.pkg.dev
docker build -t asia-southeast1-docker.pkg.dev/$GOOGLE_PROJECT/kahero/graphql:latest .
docker push asia-southeast1-docker.pkg.dev/$GOOGLE_PROJECT/kahero/graphql:latest
- name: deploy to northflank
env:
CONFIG: |
{
"external": {
"imagePath": "https://asia-southeast1-docker.pkg.dev/kahero-8dfde/kahero/graphql@${ { github.sha } }",
"credentials": "KaheroGitHubCreds"
}
}
run: |
echo "$CONFIG"
northflank update service deployment --projectId production --serviceId prod-web -i "$CONFIG"
northflank update service deployment --projectId production --serviceId prod-worker -i "$CONFIG"
northflank update service deployment --projectId production --serviceId prod-api -i "$CONFIG"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment