1 name: Hugo Build and Deploy
10 uses: actions/checkout@v2
15 # https://github.com/marketplace/actions/github-pages-action
17 uses: peaceiris/actions-hugo@v2
19 hugo-version: '0.88.1'
22 - name: Build for fascode.net
23 run: bash ./update-blog.sh
25 - name: Deploy for fascode.net
26 uses: peaceiris/actions-gh-pages@v3
28 github_token: ${{ secrets.GITHUB_TOKEN }}
29 publish_branch: public
32 - name: Build for GitHub Pages
33 run: bash ./update-blog.sh --baseURL https://hayao0819.github.io/hayao.fascode.net/blog/
35 - name: Deploy for GitHub Pages
36 uses: peaceiris/actions-gh-pages@v3
38 github_token: ${{ secrets.GITHUB_TOKEN }}
39 publish_branch: gh-pages
43 runs-on: ubuntu-latest
46 uses: actions/checkout@v2
52 uses: peaceiris/actions-hugo@v2
54 hugo-version: '0.88.1'
57 - name: Build for GitHub Pages
58 run: bash ./update-blog.sh --baseURL https://hayao0819.github.io/blog/
60 - name: Install SSH key
61 uses: shimataro/ssh-key-action@v2
63 key: ${{ secrets.GH_PAGES_REPO_DEPLOY_KEY }}
64 name: id_rsa # optional
65 known_hosts: unnecessary
69 GH_PAGES_REPO_DEPLOY_KEY: ${{ secrets.GH_PAGES_REPO_DEPLOY_KEY }}
71 echo "$GH_PAGES_REPO_DEPLOY_KEY" > ~/deploy_key.pem
72 chmod 600 ~/deploy_key.pem
73 git config --local user.email "hayao@fascode.net"
74 git config --local user.name "hayao[bot]"
75 git config pull.rebase false
76 git config remote.origin.url "git@github.com:hayao0819/hayao0819.github.io.git"
77 echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
79 if ! git diff --cached --quiet; then
80 git commit -m "deploy: ${GITHUB_SHA}" -a
82 echo "Nothing has been commited"
84 git pull --allow-unrelated-histories origin master
85 git push origin master