Skip to content

Instantly share code, notes, and snippets.

@ccfiel
Last active October 31, 2023 23:26
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/0aae45a8b4af251aa5160fd542c0461f to your computer and use it in GitHub Desktop.
Save ccfiel/0aae45a8b4af251aa5160fd542c0461f to your computer and use it in GitHub Desktop.
action
name: Veent Server Production
run-name: ${{ github.actor }} is building Veent Server Production 🚀
on:
push:
paths:
- 'apps/api/**'
jobs:
Build-Production-Server:
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 20
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: |
pnpm install
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY }}
username: ccfiel
password: ${{ secrets.TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ secrets.REGISTRY }}/${{ github.repository }}
tags: |
latest
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: apps/api
push: true
tags: ${{ steps.meta.outputs.tags }}
github.sha
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