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/cicd.yml | 93 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 .github/workflows/cicd.yml (limited to '.github/workflows/cicd.yml') 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 -- cgit v1.2.3-70-g09d2