Skip to content

Use job env

Use job env #5186

Workflow file for this run

name: Preview site
on:
push:
branches-ignore:
- master
jobs:
preview:
name: Build & Deploy
runs-on: ubuntu-latest
env:
CI: true
PREVIEW_FOLDER: ${{ GITHUB_SHA }}

Check failure on line 14 in .github/workflows/preview-site.yml

View workflow run for this annotation

GitHub Actions / Preview site

Invalid workflow file

The workflow is not valid. .github/workflows/preview-site.yml (Line: 14, Col: 23): Unrecognized named-value: 'GITHUB_SHA'. Located at position 1 within expression: GITHUB_SHA
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v3
- name: Set up Node.js
uses: actions/setup-node@v4
with:
cache: pnpm
node-version-file: package.json
- name: Install Dependencies
run: pnpm i
- name: Cache babel-loader
id: babel-loader-cache
uses: actions/cache@v4
with:
path: 'site/node_modules/.cache/babel-loader'
key: babel-loader-${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml') }}
- name: Build
run: pnpm build:site
# - name: Deploy to surge
# run: pnpm surge -p ./site/dist -d braid-design-system--${GITHUB_SHA}.surge.sh
# env:
# SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
# SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
- name: Deploy PR Preview
uses: JamesIves/github-pages-deploy-action@881db5376404c5c8d621010bcbec0310b58d5e29 # 4.6.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages-test
folder: ./site/dist
target-folder: ${{ env.PREVIEW_FOLDER }}
- name: Update PR status
run: pnpm post-commit-status
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}