CI: update publish workflow

This commit is contained in:
TEC 2024-02-21 02:53:15 +08:00
parent 891c98ac36
commit 68b5903bc6
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 14 additions and 8 deletions

View File

@ -5,6 +5,12 @@ on:
delete: delete:
ref: "refs/heads/publish" ref: "refs/heads/publish"
workflow_dispatch: workflow_dispatch:
inputs:
tmate_enabled:
type: boolean
description: 'Run a tmate session'
required: false
default: true
schedule: schedule:
- cron: "0 */2 * * *" # every 2h - cron: "0 */2 * * *" # every 2h
@ -20,7 +26,7 @@ concurrency:
jobs: jobs:
deploy: deploy:
runs-on: ubuntu-20.04 # change to -latest when possible runs-on: ubuntu-22.04 # change to -latest when possible
container: container:
image: ghcr.io/tecosaur/emacs-config:latest image: ghcr.io/tecosaur/emacs-config:latest
options: --user 0 # root options: --user 0 # root
@ -38,7 +44,7 @@ jobs:
- name: Cache Doom's Install - name: Cache Doom's Install
id: doomcache id: doomcache
uses: actions/cache@v2 uses: actions/cache@v4
with: with:
path: /home/runner/.config/emacs path: /home/runner/.config/emacs
key: ${{ runner.os }}-doom@${{ env.doom_hash }} key: ${{ runner.os }}-doom@${{ env.doom_hash }}
@ -85,19 +91,19 @@ jobs:
- name: Setup Pages - name: Setup Pages
if: (github.event_name != 'schedule' || steps.doomcache.outputs.cache-hit != 'true') && success() if: (github.event_name != 'schedule' || steps.doomcache.outputs.cache-hit != 'true') && success()
uses: actions/configure-pages@v2 uses: actions/configure-pages@v4
- name: Upload artifact - name: Upload artifact
if: (github.event_name != 'schedule' || steps.doomcache.outputs.cache-hit != 'true') && success() if: (github.event_name != 'schedule' || steps.doomcache.outputs.cache-hit != 'true') && success()
uses: actions/upload-pages-artifact@v1 uses: actions/upload-pages-artifact@v3
with: with:
path: '/home/runner/.config/doom/publish' path: '/home/runner/.config/doom/publish'
- name: Deploy to GitHub Pages - name: Deploy to GitHub Pages
if: (github.event_name != 'schedule' || steps.doomcache.outputs.cache-hit != 'true') && success() if: (github.event_name != 'schedule' || steps.doomcache.outputs.cache-hit != 'true') && success()
id: deployment id: deployment
uses: actions/deploy-pages@v1 uses: actions/deploy-pages@v4
# - name: Debug over SSH (tmate) - name: Debug over SSH (tmate)
# if: ${{ failure() }} if: ${{ github.event_name == 'workflow_dispatch' && inputs.tmate_enabled }}
# uses: mxschmitt/action-tmate@v3.1 uses: mxschmitt/action-tmate@v3