Skip to content

Manual Deploy

Manual Deploy #208

Workflow file for this run

name: Manual Deploy
on:
workflow_dispatch:
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/heads/main')
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 2
submodules: true
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
# Setting to latest causes an error during build, so temporarily fixed to the version used locally.
hugo-version: '0.111.3'
extended: true
- name: Build
run: hugo --minify
- name: Add CNAME config file
run: echo "tech.yyh-gl.dev" > ./public/CNAME
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
success_notification:
name: Success notification
needs: deploy
runs-on: ubuntu-latest
if: always()
steps:
- uses: technote-space/workflow-conclusion-action@v2
- uses: rtCamp/action-slack-notify@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_51 }}
SLACK_TITLE: Deploy Success
if: env.WORKFLOW_CONCLUSION == 'success'
failure_notification:
name: Failure notification
needs: deploy
runs-on: ubuntu-latest
if: always()
steps:
- uses: technote-space/workflow-conclusion-action@v2
- uses: rtCamp/action-slack-notify@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_51 }}
SLACK_TITLE: Deploy Failure
SLACK_COLOR: danger
if: env.WORKFLOW_CONCLUSION == 'failure'