diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index adb4624..97f0616 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -27,6 +27,8 @@ jobs: uses: actions/checkout@v2 with: ref: gh-pages + persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. + fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. - name: Download Artifact uses: actions/download-artifact@v2 @@ -34,10 +36,17 @@ jobs: name: setup path: setup.py - - name: Deploy + - name: Overwrite index.html + run: mv ./setup.py ./index.html + + - name: Commit files run: | - git config --local user.email "developomp@users.noreply.github.com" - git config --local user.name "developomp" - mv ./setup.py ./index.html # overwrite index.html - git commit -am "auto deploy from workflow" - git push + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git commit -m "auto deploy from workflow" -a + + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }}