diff --git a/.github/workflows/de.yml b/.github/workflows/de.yml new file mode 100644 index 0000000..27f286b --- /dev/null +++ b/.github/workflows/de.yml @@ -0,0 +1,43 @@ +name: GitHub Actions Build and Deploy Project +on: + push: + branches: + - master +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@master + + - name: Build and Deploy + uses: JamesIves/github-pages-deploy-action@master + env: + ACCESS_TOKEN: ${{ secrets.MY_DEPLOY_KEY }} + BRANCH: gh-pages + FOLDER: dist + BUILD_SCRIPT: yarn && build && cp ./dist/index.html ./dist/404.html && echo "pro.abckey.com" > ./dist/CNAME + - name: deploy to target directory + uses: crazy-max/ghaction-github-pages@v1 + with: + target_branch: gh-pages + build_dir: dist + repo: ibwei/vue3-base + env: + GITHUB_TOKEN: ${{ secrets.MY_DEPLOY_KEY }} + GITHUB_PAT: ${{secrets.MY_DEPLOY_KEY}} + - name: Deploy + uses: appleboy/ssh-action@master # 使用ssh链接服务器 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + port: ${{ secrets.PORT }} + script: | + rm -rf /data/www/temp + mkdir /data/www/temp + cd /data/www/temp + git clone https://github.com/ibwei/vue3-base/ + cd /data/www/temp/vue3-base + git checkout gh-pages + mv dist/* /data/www/vue3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index bf6e370..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: test -on: [push] -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - name: executing remote ssh commands using password - uses: appleboy/ssh-action@master - with: - host: ${{ secrets.REMOTE_HOST }} - username: ${{ secrets.REMOTE_USER }} - password: ${{ secrets.REMOTE_PASSWORD }} - port: ${{ secrets.REMOTE_PORT }} - script: | - rm -rf /data/www/temp - mkdir /data/www/temp - cd /data/www/temp - git clone https://github.com/ibwei/vue3-base - cd /data/www/temp/vue3-base - cnpm install - cnpm run build - mv dist/* /data/www/vue3 - -