Skip to content

Commit afc7c7e

Browse files
committed
fix workflow
1 parent cc2d8a0 commit afc7c7e

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/deploy_slides.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
name: Build Jekyll site
1+
name: Build and Deploy Slides
22
on:
33
push:
44
branches: ["main"] # Trigger the workflow on push to the main branch
5+
workflow_dispatch: # Allow manual triggering
56
permissions:
67
contents: read # Read access to repository contents
78
pages: write # Write access to GitHub Pages
@@ -19,7 +20,11 @@ jobs:
1920
node-version: '20' # Specify Node.js version 20 (LTS)
2021

2122
- name: Setup Pages
23+
id: pages
2224
uses: actions/configure-pages@v5 # Configure GitHub Pages
25+
with:
26+
enablement: true # Enable Pages if not already enabled
27+
continue-on-error: true # Continue if Pages setup fails
2328

2429
- name: Install reveal-md
2530
run: npm install -g reveal-md # Install reveal-md globally
@@ -32,14 +37,24 @@ jobs:
3237
uses: actions/upload-pages-artifact@v3 # Upload the docs folder as an artifact
3338
with:
3439
path: docs/ # Specify the path to the docs folder
40+
if: steps.pages.outcome == 'success' # Only upload if Pages was configured successfully
41+
42+
- name: Upload slides as regular artifact (fallback)
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: slides
46+
path: docs/
47+
if: steps.pages.outcome != 'success' # Upload as regular artifact if Pages not available
3548

3649
deploy:
3750
runs-on: ubuntu-latest # Use the latest Ubuntu runner
3851
needs: build # Run this job after the build job
52+
if: always() # Always try to deploy
3953
steps:
4054
- name: Deploy to GitHub Pages
4155
id: deployment
4256
uses: actions/deploy-pages@v4 # Deploy the site to GitHub Pages
57+
continue-on-error: true # Don't fail if deployment fails
4358
environment:
4459
name: github-pages # Specify the environment name
4560
url: ${{ steps.deployment.outputs.page_url }} # Set the URL of the deployed site

0 commit comments

Comments
 (0)