SpreadSheet To Site #2511
This file contains 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: SpreadSheet To Site | |
on: | |
schedule: | |
- cron: '0 1 * * *' | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- README.md | |
jobs: | |
ci: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node: [14] | |
steps: | |
- name: Checkout π | |
uses: actions/checkout@master | |
with: | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | |
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
- name: Setup node env π | |
uses: actions/[email protected] | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Get yarn cache directory path π | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Cache node_modules π¦ | |
uses: actions/cache@v2 | |
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies π¨π»βπ» | |
run: yarn | |
- name: Get data from spreadsheet π¨π»βπ» | |
env: # Or as an environment variable | |
GH_API_KEY: ${{ secrets.GH_API_KEY }} | |
API_KEY: ${{ secrets.API_KEY }} | |
SPREADSHEET_ID: ${{ secrets.SPREADSHEET_ID }} | |
run: yarn data | |
- name: Run prettier | |
run: yarn prettier | |
- name: Run unit tests | |
run: yarn test | |
- name: Create local changes & push to GitHub | |
run: | | |
yarn build | |
yarn deploy:time | |
# yarn generate | |
# echo 'findmentor.network' > ./docs/CNAME | |
git add . | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git commit -m "Add changes" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} | |
force: true |