Skip to content

Commit 245ad41

Browse files
committed
Improve overriding and defaulting for token too
1 parent 8f41377 commit 245ad41

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

β€Ž.github/workflows/pages.ymlβ€Ž

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
- main
66
- pages
77

8+
env:
9+
PAGES_ORGANIZATION: ${{ secrets.PAGES_ORGANIZATION }}
10+
PAGES_REPOSITORY: ${{ secrets.PAGES_REPOSITORY }}
11+
PAGES_ACCESS_TOKEN: ${{ secrets.PAGES_ACCESS_TOKEN }}
12+
813
jobs:
914
gh-pages:
1015
runs-on: ubuntu-latest
@@ -17,14 +22,14 @@ jobs:
1722
sudo gem install bundler
1823
bundle install
1924
20-
- name: πŸ–‰ default org
21-
if: env.PAGES_ORGANIZATION == ''
22-
run: echo "PAGES_ORGANIZATION=clarius" >> $GITHUB_ENV
23-
2425
- name: πŸ–‰ default repo
25-
if: env.PAGES_REPOSITORY == ''
26+
if: ${{ env.PAGES_REPOSITORY }} == ''
2627
run: echo "PAGES_REPOSITORY=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
2728

29+
- name: πŸ–‰ default token
30+
if: env.PAGES_ACCESS_TOKEN == ''
31+
run: echo "PAGES_ACCESS_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
32+
2833
- name: πŸ™ build
2934
run: bundle exec jekyll build -b ${{ env.PAGES_REPOSITORY }}
3035
env:
@@ -35,14 +40,14 @@ jobs:
3540
cd _site
3641
git init
3742
git add -A
38-
git config --local user.email "hello@clarius.org"
39-
git config --local user.name "GitHub Action"
43+
git config --local user.email "bot@devlooped.com"
44+
git config --local user.name "bot@devlooped.com"
4045
git commit -m "Publish pages from ${GITHUB_REPOSITORY}@${GITHUB_SHA:0:9}"
4146
4247
- name: πŸš€ push
4348
uses: ad-m/github-push-action@v0.6.0
4449
with:
45-
github_token: ${{ secrets.PAGES_ACCESS_TOKEN }}
50+
github_token: ${{ env.PAGES_ACCESS_TOKEN }}
4651
repository: ${{ env.PAGES_ORGANIZATION }}/${{ env.PAGES_REPOSITORY }}
4752
branch: gh-pages
4853
force: true

0 commit comments

Comments
Β (0)