Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

chore: create GHA workflow to deploy to Netlify #13

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy Scalar Snippetz

on:
push:
paths:
- 'demo/**'
- '.github/workflows/deploy.yml'
branches:
- 'main'

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Scalar Snippetz
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install netlify
run: pnpm install -g netlify
- name: Generate Run UUID
run: echo "DEPLOY_ID=$(uuidgen)" >> "$GITHUB_ENV" && echo $DEPLOY_ID
- name: Install dependencies
run: pnpm install
- name: Turborepo cache
uses: dtinth/setup-github-actions-caching-for-turbo@v1
- name: Build
run: pnpm turbo run build
env:
DEPLOY_ID: ${{ env.DEPLOY_ID }}
- name: Deploy to netlify
run: |
netlify deploy --dir "./demo/dist" \
--message "Deployed from Github - ${{ env.DEPLOY_ID }}" \
--site ${{ vars.NETLIFY_SITE_ID_SNIPPETZ }} \
--auth ${{ secrets.NETLIFY_AUTH_TOKEN }} \
--filter demo --prod