More CI fiddling
1. Run CI more to get around branch deletion Because my Gitea source repo deletes the CI-generated branch when it syncs to GitHub. 2. Deploy directly to GH pages This avoids the problem with gh-pages disabling when the branch is deleted. 3. A few other little tweaks
This commit is contained in:
parent
8f0a7f6a61
commit
975599e822
|
@ -1,10 +1,22 @@
|
||||||
name: "Publish"
|
name: "Publish"
|
||||||
on:
|
on:
|
||||||
pull_request:
|
|
||||||
push:
|
push:
|
||||||
branches: master
|
branches: master
|
||||||
# schedule:
|
delete:
|
||||||
# - cron: "0 */2 * * *" # every 2h
|
ref: "refs/heads/publish"
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 */2 * * *" # every 2h
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
# Allow one concurrent deployment
|
||||||
|
concurrency:
|
||||||
|
group: "pages"
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
|
@ -59,14 +71,30 @@ jobs:
|
||||||
if: github.event_name != 'schedule' || steps.doomcache.outputs.cache-hit != 'true'
|
if: github.event_name != 'schedule' || steps.doomcache.outputs.cache-hit != 'true'
|
||||||
run: runner 'cd ~/.config/doom/misc/config-publishing && ./publish.sh'
|
run: runner 'cd ~/.config/doom/misc/config-publishing && ./publish.sh'
|
||||||
|
|
||||||
- name: Deploy
|
- name: Push results
|
||||||
if: github.event_name != 'pull_request' && (github.event_name != 'schedule' || steps.doomcache.outputs.cache-hit != 'true') && success()
|
if: (github.event_name != 'schedule' || steps.doomcache.outputs.cache-hit != 'true') && success()
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
publish_dir: /home/runner/.config/doom/publish
|
publish_dir: /home/runner/.config/doom/publish
|
||||||
|
publish_branch: publish
|
||||||
force_orphan: true
|
force_orphan: true
|
||||||
|
|
||||||
- name: Debug over SSH (tmate)
|
- name: Setup Pages
|
||||||
if: ${{ failure() }}
|
if: (github.event_name != 'schedule' || steps.doomcache.outputs.cache-hit != 'true') && success()
|
||||||
uses: mxschmitt/action-tmate@v3.1
|
uses: actions/configure-pages@v2
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
if: (github.event_name != 'schedule' || steps.doomcache.outputs.cache-hit != 'true') && success()
|
||||||
|
uses: actions/upload-pages-artifact@v1
|
||||||
|
with:
|
||||||
|
path: '/home/runner/.config/doom/publish'
|
||||||
|
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
if: (github.event_name != 'schedule' || steps.doomcache.outputs.cache-hit != 'true') && success()
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v1
|
||||||
|
|
||||||
|
# - name: Debug over SSH (tmate)
|
||||||
|
# if: ${{ failure() }}
|
||||||
|
# uses: mxschmitt/action-tmate@v3.1
|
||||||
|
|
Loading…
Reference in New Issue