File tree Expand file tree Collapse file tree 4 files changed +22
-53
lines changed Expand file tree Collapse file tree 4 files changed +22
-53
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 6
6
jobs :
7
7
build :
8
8
runs-on : ubuntu-latest
9
+ environment :
10
+ name : github-pages
9
11
steps :
10
12
- name : Checkout master
11
13
uses : actions/checkout@v4
12
- with : { fetch-depth: 0 }
13
- - name : Checkout gh-pages
14
- run : git worktree add -B gh-pages public remotes/origin/gh-pages
15
- - name : Clean previous
16
- run : |
17
- find public -mindepth 1 -maxdepth 1 '!' -name .git -exec rm -rf '{}' '+'
18
14
- name : Build site
19
- uses : pdidev/pdidev.github.io/.github/actions/deploy@main
20
- with :
21
- output-directory : public
22
- gitlab-url : https://gitlab.maisondelasimulation.fr
23
- project-name : pdidev%2Fpdi
24
- - name : Add static data
25
- run : |
26
- find data -mindepth 1 -maxdepth 1 -exec cp -r '{}' public ';'
27
- - name : Add sitemap
28
- run : |
29
- ./gen_sitemap public
30
- - name : Push
15
+ env :
16
+ CI_PAGES_TOKEN : secrets.CI_PAGES_TOKEN
31
17
run : |
32
- cd public
33
- git config user.name "${GITHUB_ACTOR}"
34
- git config user.email "${GITHUB_ACTOR}@noreply.example.com"
35
- git add -A .
36
- git commit -a -m "Update to match ${GITHUB_SHA} by ${GITHUB_EVENT_NAME} ${GITHUB_RUN_NUMBER}"
37
- git push -f
18
+ ./generate _site https://gitlab.maisondelasimulation.fr pdidev%2Fpdi
19
+ find data -mindepth 1 -maxdepth 1 -exec cp -r '{}' _site ';'
20
+ ./gen_sitemap _site
21
+ - name : Upload page artifact
22
+ uses : actions/upload-pages-artifact@v3
23
+ publish :
24
+ needs : build
25
+ permissions :
26
+ pages : write
27
+ id-token : write
28
+ environment :
29
+ name : github-pages
30
+ runs-on : ubuntu-latest
31
+ steps :
32
+ - name : Deploy to GitHub Pages
33
+ id : deployment
34
+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change 8
8
fi
9
9
10
10
DEPLOY_DIR=" ${1} "
11
- cd " ${GITHUB_WORKSPACE} "
12
11
mkdir -p " ${DEPLOY_DIR} "
13
12
cd " ${DEPLOY_DIR} "
14
13
DEPLOY_DIR=" ${PWD} "
@@ -147,7 +146,7 @@ mkdir -p "${WORK_DIR}/main"
147
146
cd " ${WORK_DIR} /main"
148
147
149
148
DOWNLOAD_URL=$( curl -fs -H " Authorization: Bearer ${CI_PAGES_TOKEN} " https://api.github.com/repos/pdidev/pdi/actions/artifacts | jq -r ' .artifacts | .[] | select(.workflow_run.head_branch=="main") | .archive_download_url' )
150
- curl -H " Authorization: Bearer ${CI_PAGES_TOKEN} " -Lfso artifacts.zip " ${DOWNLOAD_URL} "
149
+ curl -H " Authorization: Bearer ${CI_PAGES_TOKEN} " -LfsSo artifacts.zip " ${DOWNLOAD_URL} "
151
150
unzip -o -d public artifacts.zip
152
151
rm artifacts.zip
153
152
if [ -d " public/main" ]
You can’t perform that action at this time.
0 commit comments