Skip to content

Commit 9d57930

Browse files
committed
Change repository
1 parent b554c2c commit 9d57930

File tree

3 files changed

+28
-52
lines changed

3 files changed

+28
-52
lines changed

.github/workflows/deploy.yml

+27-48
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,24 @@ on:
77
- master
88
pull_request:
99

10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
1015
jobs:
11-
build-deploy:
12-
runs-on: self-hosted
16+
build:
17+
runs-on: ubuntu-latest
1318
steps:
1419
- uses: actions/checkout@v4
1520
with:
1621
submodules: recursive # to fetch Hugo themes
22+
fetch-depth: 0
1723

18-
- name: Update submodules
19-
run: git submodule update --remote --recursive
20-
21-
- uses: dorny/paths-filter@v3
22-
id: changes
23-
with:
24-
filters: |
25-
src:
26-
- 'static/**'
27-
- '**/*.md'
28-
- 'layouts/**'
29-
- '!public/**'
30-
24+
- name: Setup Pages
25+
id: pages
26+
uses: actions/configure-pages@v5
27+
3128
- name: Setup Hugo
3229
uses: peaceiris/actions-hugo@v3
3330
with:
@@ -36,37 +33,19 @@ jobs:
3633

3734
- name: Build
3835
run: hugo --minify
39-
40-
- uses: webfactory/[email protected]
36+
37+
- name: Upload artifact
38+
uses: actions/upload-pages-artifact@v3
4139
with:
42-
ssh-private-key: ${{ secrets.SSH_PRIVATE_DEPLOY_KEY }}
43-
44-
- name: Prepare Git setting
45-
run: |
46-
# `actions/checkout`が設定した`url.https://github.com/.insteadOf`を消しておく。
47-
# https://github.com/actions/checkout/blob/9a9194f87191a7e9055e3e9b95b8cfb13023bb08/adrs/0153-checkout-v2.md?plain=1#L261
48-
git submodule foreach --recursive git config --local --unset-all 'url.https://github.com/.insteadOf'
49-
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
50-
git config --global user.name "github-actions[bot]"
51-
52-
- name: Commit & push
53-
run: |
54-
cd public
55-
git remote set-url origin [email protected]:urandom-ctf/urandom-ctf.github.io.git
56-
git add --all
57-
git commit -m 'Update website by ${{ github.sha }}'
58-
git push origin master
59-
if: github.event_name != 'pull_request' && steps.changes.outputs.src == 'true'
60-
61-
- name: Update submodule
62-
run: |
63-
git add public
64-
git commit -m "[skip ci] Update submodules by ${{ github.sha }}"
65-
if: github.event_name != 'pull_request' && steps.changes.outputs.src == 'true'
66-
67-
- name: Push changes
68-
uses: ad-m/github-push-action@master
69-
with:
70-
github_token: ${{ secrets.GITHUB_TOKEN }}
71-
branch: master
72-
if: github.event_name != 'pull_request' && steps.changes.outputs.src == 'true'
40+
path: ./public
41+
42+
deploy:
43+
environment:
44+
name: github-pages
45+
url: ${{ steps.deployment.outputs.page_url }}
46+
runs-on: ubuntu-latest
47+
needs: build
48+
steps:
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

.gitmodules

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
[submodule "themes/fuji"]
22
path = themes/fuji
33
url = https://github.com/dsrkafuu/hugo-theme-fuji.git
4-
[submodule "public"]
5-
path = public
6-
url = https://github.com/urandom-ctf/urandom-ctf.github.io.git
4+

public

-1
This file was deleted.

0 commit comments

Comments
 (0)