DEV Website V.1.0.0
This commit is contained in:
44
.github/workflows/merge-to-main.yml
vendored
Normal file
44
.github/workflows/merge-to-main.yml
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
name: Merge to main workflows
|
||||
|
||||
# run when a commit is pushed to "source" branch
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy-to-gh-pages:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# checkout to the commit that has been pushed
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v3.0.0
|
||||
with:
|
||||
hugo-version: 'latest'
|
||||
extended: true
|
||||
|
||||
- name: Update Hugo Modules
|
||||
run: hugo mod tidy
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: Install node modules
|
||||
run: |
|
||||
hugo mod npm pack
|
||||
npm install
|
||||
|
||||
- name: Build
|
||||
run: hugo --minify
|
||||
|
||||
# push the generated content into the `gh-pages` branch.
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v4.0.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_branch: gh-pages
|
||||
publish_dir: ./public
|
||||
Reference in New Issue
Block a user