Skip to content

Instantly share code, notes, and snippets.

@ccfiel
Created September 18, 2023 07:53
Show Gist options
  • Save ccfiel/0f8f00f2d688a37921ead849717abdf5 to your computer and use it in GitHub Desktop.
Save ccfiel/0f8f00f2d688a37921ead849717abdf5 to your computer and use it in GitHub Desktop.
name: KaHero GraphQL Server Production
run-name: ${{ github.actor }} is building KaHero GraphQL Server Production 🚀
on:
release:
types: [published]
jobs:
Build-Production-GraphQL-Server:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 20
- run: npm ci
- name: Get Latest Tag
id: latest-tag
run: echo "tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_OUTPUT
- run: VERSION=${{ steps.latest-tag.outputs.tag }} npm run version
- run: tail src/schemas/Version/queries.ts
- run: npm run build
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY }}
username: ccfiel
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ secrets.REGISTRY }}/${{ github.repository }}
tags: |
${{ steps.latest-tag.outputs.tag }}
latest
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Deploy to Northflank (production)
run: |
curl -X GET https://api-internal.northflank.com/webhooks/release-flows/${{ secrets.NF_WEB_HOOK_PRODUCTION }}?sha=${{ github.sha }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment