forked from Tylian/XKit
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix gh-pages workflow (master branch) (#2170)
- Loading branch information
1 parent
bb16651
commit 43e5e17
Showing
2 changed files
with
35 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,11 @@ on: | |
branches: | ||
- 'master' | ||
paths: | ||
- 'Extensions/dist/' | ||
- 'Extensions/dist/*' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
|
@@ -25,4 +29,14 @@ jobs: | |
run: npm ci | ||
|
||
- name: Update gh-pages | ||
run: npx gh-pages --add --dist . --src "Extensions/dist/" | ||
run: > | ||
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | ||
npx gh-pages | ||
-u "github-actions-bot <[email protected]>" | ||
--add | ||
--dist . | ||
--src "Extensions/dist/" | ||
--message 'Update Extensions/dist/' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,33 +7,24 @@ on: | |
paths: | ||
- 'Extensions/*' | ||
- 'Themes/*' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
name: Autobuild extensions | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v2.1.2 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 14 | ||
|
||
- name: Configure git | ||
run: | | ||
git config --global user.name "github-actions" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
- name: Fetch and reset gh-pages | ||
run: | | ||
git remote set-branches --add origin gh-pages | ||
git fetch | ||
git checkout -f -t -b gh-pages origin/gh-pages | ||
git reset --hard 7.9.2 | ||
cache: npm | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
@@ -47,10 +38,15 @@ jobs: | |
- name: Build distribution | ||
run: gulp build | ||
|
||
- name: Commit changes | ||
run: | | ||
git add --force Extensions/ | ||
git commit -m 'Rebuild Distribution' | ||
- name: Force-push to gh-pages | ||
run: git push -f | ||
- name: Push changes to gh-pages | ||
run: > | ||
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | ||
npx gh-pages | ||
-u "github-actions-bot <[email protected]>" | ||
--add | ||
--dist . | ||
--src "{Extensions/dist/*.json,Extensions/dist/page/gallery.json,Extensions/dist/page/list.json,Extensions/dist/page/themes.json}" | ||
--message 'Rebuild Distribution' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |