Skip to content

CI and CD

CI and CD #3333

name: CI and CD
on:
push:
branches:
- master
schedule:
- cron: '30 0,8,16 * * *'
jobs:
build-ejs-site:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set-up Node
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- name: Installing dependencies
run: npm install --loglevel verbose
- name: Generating the pages
run: npm run build
env:
COMMENTS_READ: ${{ secrets.COMMENTS_READ }}
COMMENTS_WRITE: ${{ secrets.COMMENTS_WRITE }}
- name: Deploy
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: out
jekyll: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
sitemap-publish:
runs-on: ubuntu-latest
needs: build-ejs-site
if: ${{github.event_name == 'push'}}
steps:
- name: Wait for the deployment
run: sleep 60
- name: Google
run: curl 'https://www.google.com/ping?sitemap=https%3A%2F%2Fngeojiajun.github.io%2Fsitemap.xml'
# - name: Bing
# run: curl 'https://www.bing.com/ping?sitemap=https%3A%2F%2Fngeojiajun.github.io%2Fsitemap.xml'