Skip to content

ci: update workflows config. #122

ci: update workflows config.

ci: update workflows config. #122

Workflow file for this run

name: CI
on:
push:
branches:
- master
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
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@v4
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"