Continuous Deployment #76
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 DEC,MAR,JUN,SEP *' | |
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 Artifact | |
uses: actions/upload-artifact@v2.2.3 | |
with: | |
path: public | |
name: artifact | |
# Deploy | |
deploy: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: Download Artifact | |
uses: actions/download-artifact@v2.0.9 | |
- name: Deploy to GitHub Pages | |
uses: rdarida/simple-github-pages-deploy-action@v1 | |
with: | |
git-base-folder: artifact | |
commit-message: Auto build static site |