Skip to content

Commit 0a74708

Browse files
committed
Move site generation to a script
1 parent f92b2cf commit 0a74708

File tree

4 files changed

+23
-52
lines changed

4 files changed

+23
-52
lines changed

.github/actions/deploy/Dockerfile

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

.github/actions/deploy/action.yml

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

.github/workflows/deploy.yml

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,31 @@ on:
66
jobs:
77
build:
88
runs-on: ubuntu-latest
9+
environment:
10+
name: github-pages
11+
url: ${{ steps.deployment.outputs.page_url }}
912
steps:
1013
- name: Checkout master
1114
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
1515
- name: Clean previous
1616
run: |
17-
find public -mindepth 1 -maxdepth 1 '!' -name .git -exec rm -rf '{}' '+'
18-
- 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
31-
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
17+
export CI_PAGES_TOKEN=${{secrets.CI_PAGES_TOKEN}}
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+
if: "github.event_name != 'pull_request'"
26+
permissions:
27+
pages: write
28+
id-token: write
29+
environment:
30+
name: github-pages
31+
url: ${{ steps.deployment.outputs.page_url }}
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Deploy to GitHub Pages
35+
id: deployment
36+
uses: actions/deploy-pages@v4

.github/actions/deploy/entrypoint.sh renamed to generate

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ then
88
fi
99

1010
DEPLOY_DIR="${1}"
11-
cd "${GITHUB_WORKSPACE}"
1211
mkdir -p "${DEPLOY_DIR}"
1312
cd "${DEPLOY_DIR}"
1413
DEPLOY_DIR="${PWD}"

0 commit comments

Comments
 (0)