Deploy to GitHub Pages #248
This file contains hidden or 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: Deploy to GitHub Pages | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 2 * * 0' # every Sunday at 2am UTC (10pm EST) | |
| jobs: | |
| build: | |
| name: Build Docusaurus | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: Config Docusaurus | |
| run: | | |
| git config --global user.email "verdacciobot@users.noreply.github.com" | |
| git config --global user.name "Verdaccio bot for Deployments" | |
| echo "machine github.com login verdacciobot password ${{ secrets.BOT_TOKEN }}" > ~/.netrc | |
| - name: Install pnpm | |
| run: | | |
| npm install --global corepack@latest | |
| corepack enable | |
| corepack install | |
| - name: Fetch dependencies | |
| run: pnpm install | |
| - name: Check formatting | |
| run: pnpm format:check | |
| - name: Lint | |
| run: pnpm lint | |
| - name: Build Packages | |
| run: pnpm build | |
| - name: Build Translations percentage | |
| run: pnpm --filter @verdaccio/local-scripts build | |
| - name: Build Production | |
| env: | |
| CROWDIN_VERDACCIO_API_KEY: ${{ secrets.CROWDIN_VERDACCIO_API_KEY }} | |
| CONTEXT: production | |
| run: pnpm --filter @verdaccio/website deploy:build | |
| - name: Upload Build Artifact | |
| uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 | |
| with: | |
| path: website/build | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| needs: build | |
| # Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
| permissions: | |
| pages: write # to deploy to Pages | |
| id-token: write # to verify the deployment originates from an appropriate source | |
| # Deploy to the github-pages environment | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 |