1 # このGitHub Actionsはhayao0819/hayao.fascode.net上でのみ実行されます
2 name: Hugo Build and Deploy
11 # このjobはこのリポジトリのpublicとgh-pagesリポジトリにデプロイします
13 runs-on: ubuntu-latest
16 uses: actions/checkout@v2
21 # https://github.com/marketplace/actions/github-pages-action
23 uses: peaceiris/actions-hugo@v2
25 hugo-version: '0.88.1'
28 - name: Build for fascode.net
29 run: bash ./update-blog.sh
31 - name: Deploy for fascode.net
32 uses: peaceiris/actions-gh-pages@v3
34 github_token: ${{ secrets.GITHUB_TOKEN }}
35 publish_branch: public
38 - name: Build for GitHub Pages
39 run: bash ./update-blog.sh --baseURL https://hayao0819.github.io/hayao.fascode.net/blog/
41 - name: Deploy for GitHub Pages
42 uses: peaceiris/actions-gh-pages@v3
44 github_token: ${{ secrets.GITHUB_TOKEN }}
45 publish_branch: gh-pages
48 # このjobはhayao0819/hayao0819.github.ioにリポジトリをミラーします
50 runs-on: ubuntu-latest
51 if: github.repository == 'hayao0819/hayao.fascode.net'
54 uses: actions/checkout@v2
59 - name: Install SSH key
60 uses: shimataro/ssh-key-action@v2
62 key: ${{ secrets.GH_PAGES_REPO_DEPLOY_KEY }}
63 name: id_rsa # optional
64 known_hosts: unnecessary
66 - name: Commit files to hayao0819.github.io
68 GH_PAGES_REPO_DEPLOY_KEY: ${{ secrets.GH_PAGES_REPO_DEPLOY_KEY }}
70 echo "$GH_PAGES_REPO_DEPLOY_KEY" > ~/deploy_key.pem
71 chmod 600 ~/deploy_key.pem
72 git config --local user.email "hayao@fascode.net"
73 git config --local user.name "hayao[bot]"
74 git config pull.rebase false
75 git config remote.origin.url "git@github.com:hayao0819/hayao0819.github.io.git"
76 echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
78 git checkout -b mirror
79 git pull --allow-unrelated-histories origin mirror
80 git push --force origin mirror