website/.github/workflows/main.yml

52 lines
1.4 KiB
YAML
Raw Normal View History

2021-03-09 18:56:02 +05:30
name: github pages
on:
push:
branches:
- mcaptcha.io # Set a branch to deploy
2021-03-09 18:56:02 +05:30
jobs:
2021-03-09 19:09:12 +05:30
build:
2021-03-09 18:56:02 +05:30
runs-on: ubuntu-18.04
2021-03-09 19:09:12 +05:30
2021-03-09 18:56:02 +05:30
steps:
2021-10-29 20:06:36 +05:30
- uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 15
- name: Install Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "latest"
extended: true
- name: Check install Hugo
run: hugo version
- name: Install dependencies
run: npm ci
- name: Delete temporary directories
run: npm run clean
- name: Build production website
run: npm run build
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: "mcaptcha-io-pages"
2021-10-29 20:06:36 +05:30
- name: deploy
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/mcaptcha.io' && github.repository == 'mCaptcha/website' }}
2021-10-29 20:06:36 +05:30
run: >-
curl --location --request POST "https://deploy.batsense.net/api/v1/update" --header 'Content-Type: application/json' --data-raw "{ \"secret\": \"${{ secrets.DEPLOY_TOKEN_MCAPTCHA_IO }}\", \"branch\": \"mcaptcha-io-pages\" }"