From 45956c58bed837549ec13e32e4a1ac68c5e5e8a9 Mon Sep 17 00:00:00 2001 From: developomp Date: Fri, 28 Jan 2022 15:02:26 +0900 Subject: [PATCH] replaced manual commands with github actions --- .github/workflows/deploy.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) 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 }}