name: Deploy on: push: branches: - deploy jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 with: path: webs - name: Checkout meta2d.js repo uses: actions/checkout@v3 with: repository: le5le-com/meta2d.js path: meta2d.js - name: Set up Python 3.10 uses: actions/setup-python@v4 with: python-version: '3.10' - name: Checkout 2d-components repo uses: actions/checkout@v3 with: repository: le5le-com/2d-components token: ${{ secrets.PAT }} path: 2d-components - name: Install core run: | cd meta2d.js yarn - uses: pnpm/action-setup@v2 with: version: latest - name: Build run: | cd webs pnpm i && pnpm run prod - name: 安装pipx run: | sudo apt install pipx - name: 配置pipx环境变量 run: pipx ensurepath - name: pipx completions run: pipx completions - name: 添加pipxPATH run: | eval "$(register-python-argcomplete pipx)" - name: 安装COS run: | sudo pipx install coscmd --python /opt/hostedtoolcache/Python/3.10.15/x64/bin/python3.10 - name: 配置COS env: SECRET_ID: ${{ secrets.SECRET_ID }} SECRET_KEY: ${{ secrets.SECRET_KEY }} BUCKET: ${{ secrets.BUCKET }} REGION: ${{ secrets.COS_REGION }} run: | coscmd config -a $SECRET_ID -s $SECRET_KEY -b $BUCKET -r $REGION - name: Upload COS run: | coscmd upload -rs ./webs/v/ /v/ - name: Upload index.html uses: appleboy/scp-action@v0.1.7 with: host: ${{ secrets.HOST }} username: ${{ secrets.USERNAME }} password: ${{ secrets.PASSWORD }} port: 22 source: webs/v/index.html target: ${{ secrets.WEB }}