This repository has been archived by the owner on Jun 10, 2024. It is now read-only.
chore(deps): update python dependencies (major) #390
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: OpenAPI 🔀 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
branches: | |
- develop | |
jobs: | |
generate: | |
runs-on: ubuntu-latest | |
env: | |
DEBUG: True | |
KEY: ${{ secrets.OCIAL_KEY }} | |
DB_NAME: ocialdb | |
DB_USERNAME: ${{ secrets.OCIAL_USER }} | |
DB_PASSWORD: ${{ secrets.OCIAL_PASSWORD }} | |
DB_HOST: 127.0.0.1 | |
DB_PORT: 5432 | |
steps: | |
- name: Checkout ⬇️ | |
uses: actions/[email protected] | |
with: | |
show-progress: false | |
fetch-depth: 0 | |
ssh-key: ${{ secrets.SSH_DEPLOY_KEY }} | |
- name: Setup Python 🐍 | |
uses: actions/[email protected] | |
with: | |
python-version: '3.x' | |
check-latest: true | |
- name: Install dependencies 📦 | |
run: pip install -r requirements.txt | |
- name: Build schema 🏗️ | |
run: python ./manage.py spectacular --file openapi.yaml --validate --fail-on-warn | |
- name: Check if the schema was modified | |
id: diff | |
run: echo "count=$(git status -su | grep openapi.yaml | wc -l)" >> $GITHUB_OUTPUT | |
# In case other workflows pushed changes before this one | |
- name: Pull new changes | |
if: ${{ steps.diff.outputs.count > 0 && github.event_name == 'push' }} | |
run: | | |
git config pull.rebase true | |
git config rebase.autoStash true | |
git pull | |
- name: Commit changes | |
if: ${{ steps.diff.outputs.count > 0 && github.event_name == 'push' }} | |
run: | | |
git config user.name GitHub Actions | |
git config user.email [email protected] | |
git add . | |
git commit -m "ci: update openapi.yaml" | |
git push | |
dispatch: | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' }} | |
needs: | |
- generate | |
steps: | |
- name: Trigger generation workflow in axios-apiclient | |
uses: convictional/[email protected] | |
with: | |
owner: ispp-2324-ocial | |
repo: axios-apiclient | |
github_token: ${{ secrets.DISPATCH_GH_TOKEN }} | |
workflow_file_name: generation.yml | |
ref: ${{ github.ref_name }} | |
wait_workflow: false |