1 name: Hugo Build and Deploy
11 runs-on: ubuntu-latest
14 uses: actions/checkout@v2
19 # https://github.com/marketplace/actions/github-pages-action
21 uses: peaceiris/actions-hugo@v2
23 hugo-version: '0.88.1'
26 - name: Build for fascode.net
27 run: bash ./update-blog.sh
29 - name: Deploy for fascode.net
30 uses: peaceiris/actions-gh-pages@v3
32 github_token: ${{ secrets.GITHUB_TOKEN }}
33 publish_branch: public
36 - name: Build for GitHub Pages
37 run: bash ./update-blog.sh --baseURL https://hayao0819.github.io/hayao.fascode.net/blog/
39 - name: Deploy for GitHub Pages
40 uses: peaceiris/actions-gh-pages@v3
42 github_token: ${{ secrets.GITHUB_TOKEN }}
43 publish_branch: gh-pages
47 runs-on: ubuntu-latest
50 uses: actions/checkout@v2
55 - name: Install SSH key
56 uses: shimataro/ssh-key-action@v2
58 key: ${{ secrets.GH_PAGES_REPO_DEPLOY_KEY }}
59 name: id_rsa # optional
60 known_hosts: unnecessary
62 - name: Commit files to hayao0819.github.io
64 GH_PAGES_REPO_DEPLOY_KEY: ${{ secrets.GH_PAGES_REPO_DEPLOY_KEY }}
66 echo "$GH_PAGES_REPO_DEPLOY_KEY" > ~/deploy_key.pem
67 chmod 600 ~/deploy_key.pem
68 git config --local user.email "hayao@fascode.net"
69 git config --local user.name "hayao[bot]"
70 git config pull.rebase false
71 git config remote.origin.url "git@github.com:hayao0819/hayao0819.github.io.git"
72 echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
74 git pull --allow-unrelated-histories origin mirror
75 git checkout -b mirror
76 git push --force origin mirror