chore: add sponsor badge. #121
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: CI | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-deploy: | |
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 | |
- run: npm run build | |
- name: Generate Contributors Images | |
uses: jaywcjlove/github-action-contributors@main | |
with: | |
filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\]) | |
output: dist/CONTRIBUTORS.svg | |
avatarSize: 42 | |
- name: Deploy Website | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./dist | |
# - name: Modify Version | |
# 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))' | |
# - name: Commit files | |
# run: | | |
# git config --local user.email "action@github.com" | |
# git config --local user.name "GitHub Action" | |
# git commit -m "Add changes" -a | |
# - name: Commit files | |
# run: | | |
# git config --local user.email "action@github.com" | |
# git config --local user.name "GitHub Action" | |
# git commit -m "Add changes" -a | |
# - name: Push changes | |
# uses: ad-m/github-push-action@master | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: 输出 ref | |
run: echo "${{ github.ref }}" | |
- name: 测试 nodejs 获取环境变量 | |
env: | |
NODE_API_TOKEN: ${{ secrets.NODE_API_TOKEN }} | |
run: npm run env | |
- name: mkdir -p a/b/c/d | |
run: mkdir -p a/b/c/d | |
- name: copy | |
run: | | |
cp -rf index.js a/b/c/d | |
ls -a a/b/c/d | |
- name: Test | |
run: | | |
# Strip git ref prefix from version | |
echo "${{ github.ref }}" | |
# VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
# # Strip "v" prefix from tag name | |
# [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | |
echo "$VERSION" |