chore: add vault secrets (#817) #13
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: Build and Deploy Docs | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Retrieve Secrets from Vault | |
| id: vault | |
| uses: hashicorp/vault-action@v3.4.0 | |
| with: | |
| url: ${{ secrets.VAULT_URL }} | |
| role: ${{ github.event.repository.name }}-github-action | |
| method: jwt | |
| path: github-actions | |
| exportEnv: false | |
| secrets: | | |
| github/token/${{ github.event.repository.name }}-semantic-release token | GITHUB_TOKEN ; | |
| secret/data/github/automation-app-user GH_USER_NAME | GIT_COMMITTER_NAME ; | |
| secret/data/github/automation-app-user GH_USER_EMAIL | GIT_COMMITTER_EMAIL ; | |
| - name: Checkout Repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.workflow_run.head_branch || github.ref }} | |
| token: ${{ steps.vault.outputs.GITHUB_TOKEN }} | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '20' | |
| - name: Install Dependencies | |
| run: npm ci | |
| - name: Build Docs | |
| run: npm run build:docs | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ steps.vault.outputs.GITHUB_TOKEN }} | |
| publish_dir: ./docs | |
| publish_branch: gh-pages |