This repository has been archived by the owner on Jul 20, 2024. It is now read-only.
Merge pull request #655 from albelium/dependabot/npm_and_yarn/storybo… #530
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: "Publish" | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
# 手動実行か否か | |
IS_DISPATCH: ${{ contains(fromJSON('["workflow_dispatch"]'), github.event_name) }} | |
jobs: | |
changed: | |
runs-on: ubuntu-22.04 | |
outputs: | |
docs: ${{ steps.needs.outputs.docs }} | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Paths Changes Filter | |
uses: dorny/[email protected] | |
id: changes | |
with: | |
filters: | | |
docs: | |
- 'apps/docs/**/*' | |
- 'package.json' | |
- name: Output Needs | |
id: needs | |
run: | | |
echo "docs=${{ env.IS_DISPATCH == 'true' || steps.changes.outputs.docs == 'true' }}" >> $GITHUB_OUTPUT | |
publish-docs: | |
runs-on: ubuntu-22.04 | |
needs: changed | |
if: needs.changed.outputs.docs == 'true' | |
permissions: | |
contents: read | |
deployments: write | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Create GitHub App Token | |
uses: actions/[email protected] | |
id: app-token | |
with: | |
app-id: ${{ vars.BOT_APP_ID }} | |
private-key: ${{ secrets.BOT_PRIVATE_KEY }} | |
- name: Setup Node.js environment | |
uses: actions/[email protected] | |
with: | |
node-version-file: 'package.json' | |
- name: Setup pnpm | |
uses: pnpm/[email protected] | |
- name: Clean install using pnpm | |
shell: bash | |
run: pnpm install --filter=docs --frozen-lockfile | |
- name: Build | |
run: pnpm run build --filter=docs | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/[email protected] | |
id: cloudflare-pages | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: web-application-template-docs | |
directory: ./apps/docs/dist | |
gitHubToken: ${{ steps.app-token.outputs.token }} | |
branch: main |