update content path #41
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 blog workflow | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build_job: | |
name: deploy blog | |
env: | |
HUGO_VERSION: "0.139.4" | |
HUGO_CACHEDIR: /tmp/hugo_cache | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true # Fetch Hugo themes (true OR recursive) | |
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v3 | |
with: | |
hugo-version: ${{ env.HUGO_VERSION }} | |
extended: true | |
- uses: actions/cache@v4 | |
with: | |
path: ${{ env.HUGO_CACHEDIR }} | |
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-hugomod- | |
- name: Build | |
run: hugo --minify | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v4 | |
if: github.ref == 'refs/heads/main' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public | |
# ビルドの実行結果を Slack に投稿する | |
- name: Send notification to slack channel | |
uses: rtCamp/action-slack-notify@v2 | |
if: always() | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | |
SLACK_COLOR: ${{ job.status }} | |
SLACK_MESSAGE: "Job Result: ${{ job.status }}" | |
SLACK_TITLE: Job Result | |
SLACK_USERNAME: rtamp |