Skip to content

Deploy

Deploy #274

Workflow file for this run

name: Deploy
on:
schedule:
- cron: '0 6 * * *'
workflow_dispatch:
push:
paths:
- .github/workflows/deploy.yml
- '@client/**'
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- 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 dependancies
run: pnpm install
- name: Build Packages
run: pnpm run build:ts
- name: Install dependancies
run: pnpm install
- name: Scrape lectures
run: pnpm run collect
- name: Build client
run: pnpm run build:client
env:
SITE_URL: https://${{ secrets.SITE_DOMAIN }}
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
- name: Deploy to netlify
env:
build_directory: '@client/build/client'
functions_directory: '@client/build/functions'
install_command: 'echo Skipping installing the dependencies'
build_command: 'echo Skipping building the web files'
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_DEPLOY_MESSAGE: 'Actions deploy ${{ github.ref_name }}'
NETLIFY_DEPLOY_TO_PROD: true
DEBUG: '*'
run: pnpm netlify deploy --dir='./@client/build/client' --functions='./@client/build/functions' --message='Actions deploy ${{ github.ref_name }}' --prod --filter @lectures.london/client