chore: update blog post #229
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: Workflow | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- run: npm ci | |
- run: npm run fmt.check | |
- run: npm run build | |
- if: ${{ github.event_name == 'pull_request' }} | |
run: npx vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | |
- if: ${{ github.event_name == 'pull_request' }} | |
run: echo "DEPLOYMENT_URL=$(npx vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})" >> "$GITHUB_ENV" | |
- name: Post preview url comment on PR | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: peter-evans/create-or-update-comment@v2 | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
[Preview is deployed here](${{ env.DEPLOYMENT_URL }}) | |
- if: github.ref == 'refs/heads/main' | |
run: npx vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} | |
- if: github.ref == 'refs/heads/main' | |
run: npx vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} |