name: Gitea Actions Demo
on: 
  push:
    tags: '*' 

defaults:
  run:
    shell: bash
    working-directory: /Users/mac/rp_games/rp_11001

jobs:
  Explore-Gitea-Actions:
    runs-on: mac-local
    steps:
      - name: update code 
        run: |
          pwd
          git pull
          echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
      - name: npm i
        run: |
          npm i
      - name: build
        run: |
          echo 'build'
          code=0
          /Applications/CocosCreator/Creator/3.8.5/CocosCreator.app/Contents/MacOS/CocosCreator --project ./  --build "configPath=./buildConfig_web-mobile.json;" || code=$?
          test $code -eq 36
      - name: image compression
        run: |
          compress-imgs.sh -root ./build/web-mobile/ 
      - name: upload
        run: |
          rsync -av --delete build/web-mobile/ zy@dou-dev:/data/rpgames-static/$(basename $PWD)
    