Skip to content

Commit e75166b

Browse files
Modernize GH pages
1 parent de1bde7 commit e75166b

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

.github/workflows/main.yml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ defaults:
1212
shell: bash
1313

1414
jobs:
15-
deployment:
16-
name: deployment
15+
build:
16+
name: Build
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v5
@@ -48,15 +48,26 @@ jobs:
4848
- name: Script
4949
run: .ci/script.bash
5050
- name: Before Deploy
51-
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/master' }}
5251
run: .ci/pre_deploy.bash
53-
- name: Deploy
54-
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/master' }}
55-
uses: peaceiris/actions-gh-pages@v4
52+
- name: Upload static files as artifact
53+
id: deployment
54+
uses: actions/upload-pages-artifact@v4
5655
with:
57-
github_token: ${{ secrets.GITHUB_TOKEN }}
58-
publish_dir: .
59-
destination_dir: .
60-
exclude_assets: '.github,.ci'
61-
enable_jekyll: true
62-
force_orphan: true
56+
path: docs/
57+
58+
deploy:
59+
name: Deployment
60+
needs: build
61+
runs-on: ubuntu-latest
62+
environment:
63+
name: github-pages
64+
url: ${{ steps.deployment.outputs.page_url }}
65+
permissions:
66+
actions: read # To read the artifact from the previous job
67+
id-token: write
68+
pages: write
69+
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/master' }}
70+
steps:
71+
- name: Deploy to GitHub Pages
72+
id: deployment
73+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)