Skip to content

Commit b8deaf4

Browse files
committed
implement "deploy" job which runs against master branch only
1 parent 82e6314 commit b8deaf4

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,26 @@ jobs:
6363
path: _site/
6464
retention-days: 7
6565

66-
# TODO: masterへのpushもしくはcron実行のときだけ、GitHub Pagesへアップロードする
66+
# Upload a site to GitHub Pages
67+
deploy:
68+
needs:
69+
- build
70+
environment:
71+
name: github-pages
72+
url: ${{ steps.deployment.outputs.page_url }}
73+
runs-on: ubuntu-22.04
74+
permissions:
75+
contents: read
76+
pages: write
77+
id-token: write
78+
# FIXME: cronによる実行の時もアップロードを実行する
79+
if: github.ref == 'refs/heads/master'
80+
steps:
81+
- name: Deploy to Github Pages
82+
id: deployment
83+
uses: actions/deploy-pages@v4
84+
85+
# TODO: レポジトリ側の設定:
86+
#
87+
# * Actionsを使うこと
88+
# * page write パーミッション

0 commit comments

Comments
 (0)