fix: asset links once again due to a bad workflow run: https://github… #49
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 | |
permissions: | |
deployments: write | |
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' | |
- uses: chrnorm/deployment-action@v2 | |
name: Create GitHub deployment | |
id: deployment | |
with: | |
token: '${{ github.token }}' | |
environment-url: https://www.arun.blog | |
environment: Production | |
- 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 }} | |
- name: Update deployment status (success) | |
if: success() | |
uses: chrnorm/deployment-status@v2 | |
with: | |
token: '${{ github.token }}' | |
environment-url: ${{ steps.deployment.outputs.environment_url }} | |
deployment-id: ${{ steps.deployment.outputs.deployment_id }} | |
state: 'success' | |
- name: Update deployment status (failure) | |
if: failure() | |
uses: chrnorm/deployment-status@v2 | |
with: | |
token: '${{ github.token }}' | |
environment-url: ${{ steps.deployment.outputs.environment_url }} | |
deployment-id: ${{ steps.deployment.outputs.deployment_id }} | |
state: 'failure' |