diff --git a/.github/workflows/npm-gulp.yml b/.github/workflows/npm-gulp.yml index f04acb8..2bca373 100644 --- a/.github/workflows/npm-gulp.yml +++ b/.github/workflows/npm-gulp.yml @@ -28,15 +28,27 @@ jobs: - name: Build with Gulp run: npx gulp - - name: Copy dist contents to root - run: cp -r dist/* $GITHUB_WORKSPACE/ + - name: Commit dist folder to deploy branch + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git checkout -b deploy-dist + git add dist + git commit -m "Deploy dist folder" + git push origin deploy-dist deploy: runs-on: ubuntu-latest needs: build steps: - - name: List current working directory - run: ls -l + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Fetch deploy-dist branch + run: git fetch origin deploy-dist:deploy-dist + + - name: Switch to deploy-dist branch + run: git checkout deploy-dist - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3