OSDN Git Service

[fix] : Fixed username
[alterlinux/hayao.fascode.net.git] / .github / workflows / hugo.yaml
1 name: Hugo Build and Deploy
2
3 on: push
4
5 jobs:
6   gh-pages:
7     runs-on: ubuntu-latest
8     steps:
9       - name: Checkout
10         uses: actions/checkout@v2
11         with:
12           submodules: true
13           fetch-depth: 0 
14
15       # https://github.com/marketplace/actions/github-pages-action
16       - name: Setup
17         uses: peaceiris/actions-hugo@v2
18         with:
19           hugo-version: '0.88.1'
20           extended: true
21
22       - name: Build for fascode.net
23         run: bash ./update-blog.sh
24         #run: hugo --minify -D
25
26       - name: Deploy for fascode.net
27         uses: peaceiris/actions-gh-pages@v3
28         with:
29           github_token: ${{ secrets.GITHUB_TOKEN }}
30           publish_branch: public
31           publish_dir: ./
32
33       - name: Build for GitHub Pages
34         run: bash ./update-blog.sh --baseURL https://hayao0819.github.io/hayao.fascode.net/blog/
35         #run: hugo --minify -D
36
37       - name: Deploy for GitHub Pages
38         uses: peaceiris/actions-gh-pages@v3
39         with:
40           github_token: ${{ secrets.GITHUB_TOKEN }}
41           publish_branch: gh-pages
42           publish_dir: ./
43
44   main-repo:
45     runs-on: ubuntu-latest
46     steps:
47       - name: Checkout
48         uses: actions/checkout@v2
49         with:
50           submodules: true
51           fetch-depth: 0 
52
53       - name: Setup
54         uses: peaceiris/actions-hugo@v2
55         with:
56           hugo-version: '0.88.1'
57           extended: true
58
59       - name: Build for GitHub Pages
60         run: bash ./update-blog.sh --baseURL https://hayao0819.github.io/blog/
61         #run: hugo --minify -D
62
63       - name: Pushes to another repository
64         uses: cpina/github-action-push-to-another-repository@main
65         env:
66           API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
67         with:
68           source-directory: './'
69           destination-github-username: 'Hayao0819'
70           destination-repository-name: 'hayao0819.github.io'
71           user-email: hayao@fascode.net
72           user-name: Hayao0819
73           target-branch: master
74