problem(A1047): fix std #53
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: Problem Continuous Deployment | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
outputs: | |
should_deploy: ${{ steps.check.outputs.should_deploy }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Check contain create problem task | |
id: check | |
run: | | |
if [[ $(git log -1 --pretty=%B) =~ "create:" ]]; then | |
echo "::set-output name=should_deploy::true" | |
else | |
echo "::set-output name=should_deploy::false" | |
fi | |
create: | |
needs: check | |
runs-on: ubuntu-latest | |
if: ${{ needs.check.outputs.should_deploy == 'true' }} | |
environment: oj | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Deployment | |
run: python manager.py cd | |
env: | |
TOKEN: ${{ secrets.TOKEN }} |