debug: just checking something before trying with GITHUB_PAT_FOR_DEPL… #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: '${{ secrets.GITHUB_TOKEN }}' | |
environment-url: https://arun.blog | |
environment: production |