Update _index.md #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |