Skip to content

Commit 8f41377

Browse files
committed
Allow overriding target pages org
Introduce PAGES_* variables for ORGANIZATION, REPOSITORY and ACCESS_TOKEN, so the script is more generic.
1 parent 514760d commit 8f41377

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/pages.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@ jobs:
1717
sudo gem install bundler
1818
bundle install
1919
20-
- name: 🖉 repo
21-
run: echo "REPOSITORY=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
20+
- name: 🖉 default org
21+
if: env.PAGES_ORGANIZATION == ''
22+
run: echo "PAGES_ORGANIZATION=clarius" >> $GITHUB_ENV
23+
24+
- name: 🖉 default repo
25+
if: env.PAGES_REPOSITORY == ''
26+
run: echo "PAGES_REPOSITORY=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
2227

2328
- name: 🙏 build
24-
run: bundle exec jekyll build -b ${{ env.REPOSITORY }}
29+
run: bundle exec jekyll build -b ${{ env.PAGES_REPOSITORY }}
2530
env:
2631
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2732

@@ -37,8 +42,8 @@ jobs:
3742
- name: 🚀 push
3843
uses: ad-m/[email protected]
3944
with:
40-
github_token: ${{ secrets.CLARIUS_ACCESS_TOKEN }}
41-
repository: clarius/${{ env.REPOSITORY }}
45+
github_token: ${{ secrets.PAGES_ACCESS_TOKEN }}
46+
repository: ${{ env.PAGES_ORGANIZATION }}/${{ env.PAGES_REPOSITORY }}
4247
branch: gh-pages
4348
force: true
4449
directory: ./_site

0 commit comments

Comments
 (0)