Skip to content

Build & Deploy

Build & Deploy #67

Workflow file for this run

name: Build & Deploy
on:
push:
branches:
- master
tags:
- v*
schedule:
- cron: '0 0 * * 0'
jobs:
build-deploy:
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
ID: ${{ secrets.GITHUB_ID }}
SECRET: ${{ secrets.GITHUB_SECRET }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- run: npm install
- name: Modify Version(Date)
shell: bash
run: |
node -e 'var pkg = require("./package.json"); pkg.version= (new Date().getFullYear().toString().substr(2)) + "." + (new Date().getMonth() + 1) + "." + (new Date().getDate()); require("fs").writeFileSync("./package.json", JSON.stringify(pkg, null, 2))'
- run: npm run get:trending
- run: npm run get:repos
- run: npm run get:users
- run: npm run get:users:vietnam
- run: cat .cache/users.json
- run: cat .cache/users.vietnam.json
- run: npm run get:users:info
- run: npm run start
- run: mkdir -p web/data
- run: cp -rf dist/* web/data
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./web
user_name: github-actions[bot]
user_email: github-actions[bot]@users.noreply.github.com