Skip to content

Instantly share code, notes, and snippets.

@ccfiel
Last active September 12, 2023 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ccfiel/d8d4a03fb0ddb39e432e62e6d97efcb3 to your computer and use it in GitHub Desktop.
Save ccfiel/d8d4a03fb0ddb39e432e62e6d97efcb3 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: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ secrets.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ secrets.REGISTRY }}/${{ github.repository }}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Deploy to Northflank (production)
env:
CONFIG: |
{
"external": {
"imagePath": "https://ghcr.io/kahero-team/graphql-server:main:${{ github.sha }}",
"credentials": "KaheroGitHubCreds"
}
}
run: |
npm i @northflank/cli -g
echo "$CONFIG"
northflank login --token ${{ secrets.NF_TOKEN }}
northflank update service deployment --projectId kahero --serviceId graphql-server -i "$CONFIG"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment