Skip to content

Fix Deployments (#54) #38

Fix Deployments (#54)

Fix Deployments (#54) #38

name: Build and Deploy
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
workflow_run:
workflows: ['Commit Notion changes']
branches: [main]
types:
- completed
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-24.04
env:
TZ: 'America/Los_Angeles'
steps:
- uses: actions/checkout@v4
- name: Set Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Run install
uses: borales/actions-yarn@v5
with:
cmd: install
- name: Fix Formatting
uses: borales/actions-yarn@v5
with:
cmd: format:write
- name: Build production files
uses: borales/actions-yarn@v5
with:
cmd: build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: dist
formatting:
runs-on: ubuntu-24.04
env:
TZ: 'America/Los_Angeles'
steps:
- uses: actions/checkout@v4
- name: Set Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Run install
uses: borales/actions-yarn@v5
with:
cmd: install
- name: Check Formatting
uses: borales/actions-yarn@v5
with:
cmd: format:check
deploy:
if: ${{ github.event_name != 'pull_request' }}
needs: build
runs-on: ubuntu-24.04
env:
TZ: 'America/Los_Angeles'
steps:
- uses: actions/checkout@v4
- name: Set Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: dist
- name: Run install
uses: borales/actions-yarn@v5
with:
cmd: install
dir: 'compute-js'
- name: fastly compute deploy
uses: fastly/compute-actions@v8
with:
project_directory: compute-js
comment: “Deployed via GitHub Actions”
env:
FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}
- uses: chrnorm/deployment-action@v2
name: Create GitHub deployment
id: deployment
with:
token: '${{ github.token }}'
environment-url: https://arun.blog
environment: production