-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (63 loc) · 1.81 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Deploy
on:
push:
branches:
- main
paths:
- 'content/about/**'
- 'content/post/**'
- 'content/log/**'
- 'content/scraps/**'
- 'content/hobby/**'
pull_request:
types: [closed]
workflow_dispatch:
jobs:
deploy:
# if: ${{ github.event_name == 'push' || github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
token: ${{secrets.GITHUB_TOKEN}}
# OGP の作成
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r scripts/ogp/requirements.txt
- name: Run main.py
id: latest_data_id
run: |
cd scripts/ogp/
python main.py
- name: Update README.md
run: |
git add -N static/img/images/*.png
if ! git diff --exit-code --quiet static/img/images/*.png
then
git config --global user.name haytok
git config --global user.email [email protected]
git pull
git add static/img/images/*.png
git commit -m 'update OGP images'
git push origin main
fi
# ビルドとデプロイ
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.110.0'
- name: Build
run: hugo --minify
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public