Update cd.yml #83
This file contains hidden or 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: Continuous Deployment | |
on: | |
push: | |
branches: [master] | |
schedule: | |
- cron: '0 0 1 * *' | |
workflow_dispatch: | |
jobs: | |
# Build | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v2.1.2 | |
- name: Clean Install Packages | |
run: yarn cache clean && yarn install | |
- name: Clean Gatsby Cache | |
run: yarn clean | |
- name: Build Gatsby Site | |
run: yarn build | |
env: | |
CONTENTFUL_ACCESS_TOKEN: ${{ secrets.CONTENTFUL_ACCESS_TOKEN }} | |
- name: Upload GitHub Pages artifact | |
uses: actions/upload-pages-artifact@v3.0.1 | |
with: | |
path: public | |
# Deploy | |
deploy: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Configure GitHub Pages | |
uses: actions/configure-pages@v5.0.0 | |
- name: Deploy GitHub Pages site | |
uses: actions/deploy-pages@v4.0.5 |