Skip to content

Commit 08b7ec5

Browse files
chore: add vault secrets (#817)
1 parent 5cbb2c0 commit 08b7ec5

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/pages-build-deployment.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,33 @@ on:
99
permissions:
1010
contents: read
1111
pages: write
12+
id-token: write
1213

1314
jobs:
1415
build:
1516
runs-on: ubuntu-latest
1617

1718
steps:
19+
- name: Retrieve Secrets from Vault
20+
id: vault
21+
uses: hashicorp/vault-action@v3.4.0
22+
with:
23+
url: ${{ secrets.VAULT_URL }}
24+
role: ${{ github.event.repository.name }}-github-action
25+
method: jwt
26+
path: github-actions
27+
exportEnv: false
28+
secrets: |
29+
github/token/${{ github.event.repository.name }}-semantic-release token | GITHUB_TOKEN ;
30+
secret/data/github/automation-app-user GH_USER_NAME | GIT_COMMITTER_NAME ;
31+
secret/data/github/automation-app-user GH_USER_EMAIL | GIT_COMMITTER_EMAIL ;
32+
1833
- name: Checkout Repository
1934
uses: actions/checkout@v3
35+
with:
36+
fetch-depth: 0
37+
ref: ${{ github.event.workflow_run.head_branch || github.ref }}
38+
token: ${{ steps.vault.outputs.GITHUB_TOKEN }}
2039

2140
- name: Set up Node.js
2241
uses: actions/setup-node@v3
@@ -32,6 +51,6 @@ jobs:
3251
- name: Deploy to GitHub Pages
3352
uses: peaceiris/actions-gh-pages@v4
3453
with:
35-
github_token: ${{ secrets.GITHUB_TOKEN }}
54+
github_token: ${{ steps.vault.outputs.GITHUB_TOKEN }}
3655
publish_dir: ./docs
3756
publish_branch: gh-pages

0 commit comments

Comments
 (0)