1
0
Fork 0

fixed workflow

This commit is contained in:
Kim, Jimin 2022-01-28 15:33:03 +09:00
parent 45956c58be
commit d4f03a5cbe

View file

@ -9,9 +9,9 @@ on:
- setup.py - setup.py
jobs: jobs:
build_and_deploy: get_script:
if: ${{ github.repository_owner == 'developomp' }} # prevents workflow from running in forked repos if: ${{ github.repository_owner == 'developomp' }} # prevents workflow from running in forked repos
name: Deploy name: Get script
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout master - name: Checkout master
@ -23,6 +23,12 @@ jobs:
name: setup name: setup
path: setup.py path: setup.py
deploy_script:
if: ${{ github.repository_owner == 'developomp' }} # prevents workflow from running in forked repos
name: Deploy script
runs-on: ubuntu-latest
needs: get_script
steps:
- name: Checkout gh-pages - name: Checkout gh-pages
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
@ -37,16 +43,19 @@ jobs:
path: setup.py path: setup.py
- name: Overwrite index.html - name: Overwrite index.html
run: mv ./setup.py ./index.html run: |
mv ./setup.py/setup.py ./index.html
rm -rf ./setup.py
- name: Commit files - name: Commit files
run: | run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]" git config --local user.name "github-actions[bot]"
git commit -m "auto deploy from workflow" -a git add index.html
git commit -m "auto deploy from workflow"
- name: Push changes - name: Push changes
uses: ad-m/github-push-action@master uses: ad-m/github-push-action@master
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }} branch: gh-pages