[ADD] baekjoon 21944 python solution (#95) #120
This file contains hidden or 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: Auto Solution Upload | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'solutions/**' | |
| - 'scripts/**' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| API_AUTH_URL: ${{ secrets.API_AUTH_URL }} | |
| API_SOLUTION_URL: ${{ secrets.API_SOLUTION_URL }} | |
| API_SYSTEM_USER_ID: ${{ secrets.API_SYSTEM_USER_ID }} | |
| API_SYSTEM_USER_PW: ${{ secrets.API_SYSTEM_USER_PW }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Setup Python | |
| uses: actions/setup-python@v1 | |
| with: | |
| python-version: '3.x' | |
| architecture: 'x64' | |
| - name: Setup pip | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Run python code | |
| run: | | |
| python scripts/push_solution.py | |
| - name: Pull | |
| if: success() | |
| uses: EndBug/add-and-commit@v9 | |
| with: | |
| pull: "--rebase --autostash" | |
| push: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
| - name: Config Github | |
| if: | |
| run: | | |
| if [[ $(git diff --name-only solutions.json) ]]; then | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "tony9402" | |
| git add solutions.json | |
| git commit -m "Update Solution Data" | |
| fi | |
| - name: Push | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GH_TOKEN }} | |
| branch: ${{ github.ref }} |