From 20c63cb6b18ee70b874ba63c1ad6212af165b291 Mon Sep 17 00:00:00 2001 From: A Farzat Date: Sun, 12 Oct 2025 10:31:08 +0300 Subject: Merge GitHub workflows to one --- .github/workflows/ci.yml | 32 --------------- .github/workflows/cicd.yml | 93 ++++++++++++++++++++++++++++++++++++++++++++ .github/workflows/deploy.yml | 68 -------------------------------- 3 files changed, 93 insertions(+), 100 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/cicd.yml delete mode 100644 .github/workflows/deploy.yml (limited to '.github') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index ddc52e2..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Continuous Integration - -on: - push: - branches: [ deploy, main ] - pull_request: - branches: [ deploy, main ] - -jobs: - python-tests: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.13' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - pip install mypy - - - name: Run unit tests - run: python -m unittest tests/*.py - - - name: Run type checking - run: mypy --explicit-package-bases --strict . diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml new file mode 100644 index 0000000..217d8cd --- /dev/null +++ b/.github/workflows/cicd.yml @@ -0,0 +1,93 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: [ deploy ] + pull_request: + branches: [ deploy ] + +concurrency: + group: "pages" + cancel-in-progress: true + +permissions: + contents: read + pages: write + id-token: write + +jobs: + python-tests: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.13' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install mypy + + - name: Run unit tests + run: python -m unittest tests/*.py + + - name: Run type checking + run: mypy --explicit-package-bases --strict . + + build: + runs-on: ubuntu-latest + needs: python-tests + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'npm' + cache-dependency-path: 'front-end/package-lock.json' + + - name: Create env file + run: | + echo "VITE_API_BASE_URL=https://flask.csca5028.farzat.xyz/" > front-end/.env + working-directory: ./ + + - name: Install dependencies + run: npm ci + working-directory: ./front-end + + - name: Build + run: npm run build + working-directory: ./front-end + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./front-end/dist + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + + permissions: + pages: write + id-token: write + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 7ec94f5..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Deploy to GitHub Pages - -on: - push: - branches: [ deploy ] - pull_request: - branches: [ deploy ] - -concurrency: - group: "pages" - cancel-in-progress: true - -permissions: - contents: read - pages: write - id-token: write - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '18' - cache: 'npm' - cache-dependency-path: 'front-end/package-lock.json' - - - name: Create env file - run: | - echo "VITE_API_BASE_URL=https://flask.csca5028.farzat.xyz/" > front-end/.env - working-directory: ./ - - - name: Install dependencies - run: npm ci - working-directory: ./front-end - - - name: Build - run: npm run build - working-directory: ./front-end - - - name: Setup Pages - uses: actions/configure-pages@v4 - - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: ./front-end/dist - - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - - permissions: - pages: write - id-token: write - - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 -- cgit v1.2.3-70-g09d2