Skip to content

Commit eab0b38

Browse files
authored
Update and rename publish_sites.yml to publish_staging.yml
use the file only on develop
1 parent 5a06f1a commit eab0b38

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
name: Build and publish TED Developer Docs
1+
name: Build and publish TED Developer Docs on staging
22

33
on:
44
workflow_dispatch:
55
push:
66
branches:
7-
- master
87
- develop
98

109
jobs:
@@ -36,21 +35,21 @@ jobs:
3635
- name: Generate site
3736
run: yarn run build
3837

39-
- name: Deploy production (master branch)
40-
if: github.ref == 'refs/heads/master'
41-
uses: JamesIves/github-pages-deploy-action@v4
38+
# Authenticate with GitHub App
39+
- name: Generate GitHub App token
40+
id: app-token
41+
uses: tibdex/github-app-token@v2
4242
with:
43-
token: "${{ github.token }}"
44-
folder: build/site
45-
branch: gh-pages
46-
commit-message: "[CI] Publish Documentation for ${{ github.sha }}"
47-
43+
app_id: ${{ secrets.APP_ID }}
44+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
45+
installation_id: ${{ secrets.INSTALLATION_ID }}
46+
4847
- name: Deploy staging (develop branch)
4948
if: github.ref == 'refs/heads/develop'
5049
uses: JamesIves/github-pages-deploy-action@v4
5150
with:
52-
token: "${{ secrets.STAGING_TOKEN }}"
5351
repository-name: OP-TED/docs-staging
5452
folder: build/site
5553
branch: gh-pages
54+
token: ${{ steps.app-token.outputs.token }}
5655
commit-message: "[CI] Publish STAGING Docs for ${{ github.sha }}"

0 commit comments

Comments
 (0)