chore(deps-dev): bump prettier from 2.8.8 to 3.0.0 #63
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: Build | |
on: | |
#push: | |
# branches: | |
# - master | |
#workflow_dispatch: | |
env: | |
UPSTREAM_REPOSITORY: gedoor/legado_web_bookshelf | |
jobs: | |
master: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout legado_web_bookshelf Project | |
uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install Project | |
run: | | |
npm install | |
- name: Format code | |
if: ${{ github.repository == env.UPSTREAM_REPOSITORY }} | |
run: | | |
npm run-script lint | |
- name: push changes | |
if: ${{ github.repository == env.UPSTREAM_REPOSITORY }} | |
uses: stefanzweifel/[email protected] | |
with: | |
commit_message: 'style: format code' | |
file_pattern: src | |
- name: Build | |
run: | | |
export NODE_OPTIONS=--openssl-legacy-provider | |
npm run-script build | |
- name: Set Env | |
if: ${{ github.repository == env.UPSTREAM_REPOSITORY }} | |
shell: bash | |
run: | | |
version="v$(date -d "8 hour" -u +3.%y.%m%d%H)" | |
echo "APP_VER=$version" >> $GITHUB_ENV | |
- name: Push changes to legado | |
continue-on-error: true | |
if: ${{ github.repository == env.UPSTREAM_REPOSITORY }} | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git clone "https://gedoor:${{ secrets.ACTIONS_TOKEN }}@github.com/gedoor/legado" --depth 1 | |
rm -rf legado/app/src/main/assets/web/bookshelf/* | |
mv -f $GITHUB_WORKSPACE/dist/* legado/app/src/main/assets/web/bookshelf/ | |
cd legado | |
git add -A | |
git commit -m "web bookshelf: ${{ env.APP_VER }}" | |
git push |