Skip to content

Commit 1411e50

Browse files
authored
Merge pull request #22 from thewtex/main
ENH: Use Deploy to GitHub Pages Action
2 parents 792a7e6 + 351a4b4 commit 1411e50

File tree

2 files changed

+31
-94
lines changed

2 files changed

+31
-94
lines changed

.github/workflows/Doxygen.yml

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88

99
jobs:
1010
doxygen:
11-
1211
runs-on: ubuntu-24.04
1312

1413
steps:
@@ -59,17 +58,40 @@ jobs:
5958
env:
6059
GH_TOKEN: ${{ secrets.github_token }}
6160

62-
- name: Update gh-pages
61+
- name: Prepare HTML for GitHub Pages
6362
if: github.ref == 'refs/heads/main'
6463
run: |
6564
tar -zxf artifacts/ITKDoxygen-*.tar.gz
6665
touch html/.nojekyll
67-
git update-ref refs/heads/${TARGET_BRANCH} origin/${TARGET_BRANCH}
68-
./update-gh-pages.sh html
69-
repo_uri="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
70-
git push $repo_uri ${TARGET_BRANCH}
71-
env:
72-
GITHUB_TOKEN: ${{ secrets.github_token }}
73-
TARGET_BRANCH: 'gh-pages'
66+
67+
- name: Upload Pages artifact
68+
if: github.ref == 'refs/heads/main'
69+
uses: actions/upload-pages-artifact@v3
70+
with:
71+
path: html
72+
retention-days: 7
73+
74+
deploy-gh-pages:
75+
needs: doxygen
76+
runs-on: ubuntu-24.04
77+
78+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
79+
permissions:
80+
contents: read
81+
pages: write # to deploy to Pages
82+
id-token: write # to verify the deployment originates from an appropriate source
83+
84+
# Deploy to the github-pages environment
85+
environment:
86+
name: github-pages
87+
url: ${{ steps.deployment.outputs.page_url }}
88+
89+
steps:
90+
- name: Deploy to GitHub Pages
91+
if: github.ref == 'refs/heads/main'
92+
id: deployment
93+
uses: actions/deploy-pages@v4
94+
# with:
95+
# preview: true <-> currently not available to the public
7496

7597

update-gh-pages.sh

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)