fix: docs permissions #5
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: Main | |
on: | |
push: | |
branches: ["main"] | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
# Build | |
build: | |
if: github.repository == 'SundaeSwap-finance/sundae-sdk' | |
permissions: | |
id-token: write | |
contents: write | |
pages: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: oven-sh/setup-bun@v1 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
# Install dependencies | |
- name: Install | |
run: bun install --frozen-lockfile --ignore-scripts | |
# Build dist folders | |
- name: Build | |
run: bun run build | |
# Run Tests | |
- name: Run Tests | |
run: bun test:all | |
# Bump Versions (reinstate after release) | |
- name: Release | |
uses: changesets/action@v1 | |
with: | |
publish: bun changeset publish | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | |
# Deploy Documentation | |
docs: | |
if: github.repository == 'SundaeSwap-finance/sundae-sdk' | |
permissions: | |
id-token: write | |
pages: write | |
contents: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Build Documentation Site | |
- name: Setup Pages | |
uses: actions/configure-pages@v2 | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: ./docs | |
destination: ./_site | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |