Add permissions for upstream job #44
Workflow file for this run
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: CI Scripts π§Ύ for Web Branches β | |
on: | |
push: | |
branches: | |
- web-dev | |
pull_request: | |
branches: | |
- web | |
- web-dev | |
jobs: | |
chromatic: | |
name: Publish Storybook to Chromatic π | |
env: | |
GH_PFP_TOKEN: ${{ secrets.GH_PFP_TOKEN }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20.11.0' | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
- name: Install dependencies | |
run: cd noplus-web && npm i | |
- name: Publish to Chromatic | |
uses: chromaui/action@latest | |
with: | |
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
workingDir: noplus-web | |
StoryBook: | |
name: Build StoryBook π | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code π¦ | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup node π¦ | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20.11.0' | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
- name: Install dependencies π¦ | |
run: cd noplus-web && npm i | |
- name: Build Storybook π | |
run: cd noplus-web && npm run build-storybook | |
- name: Send Build to Upload Authority | |
uses: actions/upload-artifact@v2 | |
with: | |
name: storybook | |
path: noplus-web/storybook-static | |
StoryDocs: | |
name: Build StoryDocs π | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code π¦ | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup node π¦ | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20.11.0' | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
- name: Install dependencies π¦ | |
run: cd noplus-web && npm i | |
- name: Build StoryDocs π | |
run: cd noplus-web && npm run build-storydocs | |
- name: Send Build to Upload Authority | |
uses: actions/upload-artifact@v2 | |
with: | |
name: storydocs | |
path: noplus-web/storybook-static | |
upstream: | |
name: Upload Authority π¦ | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
pull-requests: write | |
needs: [StoryBook, StoryDocs] | |
steps: | |
- name: Checkout code π¦ | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download Storybook π | |
uses: actions/download-artifact@v2 | |
with: | |
name: storybook | |
path: docs/storybook | |
- name: Download StoryDocs π | |
uses: actions/download-artifact@v2 | |
with: | |
name: storydocs | |
path: noplus-web/public/storydocs | |
- name: Activate Vercel Deployment | |
run: | | |
echo '{"github": {"enabled": true}}' > vercel.json | |
- name: Commit Changes π¦ | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add vercel.json | |
git add noplus-web/public/storydocs | |
git add docs/storybook | |
git commit -m "Deploy Storybook and StoryDocs to Vercel π" | |
- name: Push to Current Branch π¦ | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |