Skip to content

fix : update env vars #103

fix : update env vars

fix : update env vars #103

Workflow file for this run

name: Build
on:
push:
branches:
- main
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
changes:
name: Detect files changes
runs-on: ubuntu-latest
timeout-minutes: 3
outputs:
web: ${{ steps.filter.outputs.web }}
api: ${{ steps.filter.outputs.api }}
docs: ${{ steps.filter.outputs.docs }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
web:
- './.github/workflows/Build.yml'
- './web/**'
api:
- '!./.github/workflows/Build.yml'
- '!./web/**'
docs:
- './README.md'
- './web/README.md'
- name: List all changed files
run: echo steps.filter.outputs
build-web:
name: Build Web
runs-on: ubuntu-latest
needs: changes
# if: ${{needs.changes.outputs.web == 'true'}}
defaults:
run:
working-directory: ./web
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Decrypt large secret
shell: bash
run: |
../scripts/decrypt_secret_web.sh
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
- name: Install dependencies
run: |
npm install
- name: Build Next.js App
run: |
cat .env.local
npm run build
# - name: Deploy
# uses: FirebaseExtended/action-hosting-deploy@v0
# with:
# repoToken: ${{ secrets.GITHUB_TOKEN }}
# firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
# projectId: ${{ secrets.WEB_PROJECT_ID }}
# entryPoint: ./web
# channelId: live
# env:
# FIREBASE_CLI_EXPERIMENTS: webframeworks
build-api:
name: Build API
runs-on: ubuntu-latest
needs: changes
# if: ${{needs.changes.outputs.api == 'true'}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Decrypt large secret
shell: bash
run: |
./scripts/decrypt_secret_api.sh
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Cache PipEnv
id: cache-pipenv
uses: actions/cache@v4
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pipenv
- name: Install pipenv
run: |
python -m pip install --upgrade pipenv wheel
- name: Install dependencies
run: |
pipenv install --deploy --dev
- name: Run tests
run: |
pipenv run coverage run --source='.' ./manage.py test
env:
SECRET_KEY: "NSNLNDNLN"
- name: Generate coverage report
run: |
pipenv run coverage xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}