Deploy 12 Days ALife #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy 12 Days ALife | |
on: | |
schedule: | |
- cron: '*/6 * * * *' # minimum interval is 5 minutes | |
env: | |
BASE_BRANCH_NAME: 12-days-alife | |
HOSTING_BRANCH_NAME: gh-pages-12-days-alife | |
LOCAL_BRANCH_NAME: gh-pages-local-12-days-alife | |
jobs: | |
Echo: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.6.7' | |
- name: Setup git | |
run: | | |
git config user.name "GitHub Actions Bot" | |
git config user.email "<>" | |
cd $GITHUB_WORKSPACE | |
git fetch | |
- name: Clean up | |
continue-on-error: true | |
run: | | |
git branch -d $LOCAL_BRANCH_NAME | |
- name: Checkout | |
run: | | |
git fetch | |
git checkout $BASE_BRANCH_NAME | |
git pull | |
git checkout -b $LOCAL_BRANCH_NAME | |
- name: Build | |
id: build_step | |
run: | | |
python 12DaysAlife.py | |
- name: Teardown when the workflow failed | |
if: failure() && steps.build_step.outcome == 'failure' | |
run: | | |
git stash -u |