Local B2B IPC fix (add in DLA) #1292
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
| # Generated by cdkactions. Do not modify | |
| # Generated as part of the 'cdk' stack. | |
| name: Workflow | |
| on: push | |
| jobs: | |
| django-check: | |
| name: Django Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Cache | |
| uses: actions/cache@v2 | |
| with: | |
| path: ~/.local/share/virtualenvs | |
| key: v0-${{ hashFiles('backend/Pipfile.lock') }} | |
| - name: Install Dependencies | |
| run: |- | |
| cd backend | |
| pip install pipenv | |
| pipenv install --deploy --dev | |
| - name: Lint (flake8) | |
| run: |- | |
| cd backend | |
| pipenv run flake8 . | |
| - name: Lint (black) | |
| run: |- | |
| cd backend | |
| pipenv run black --check . | |
| - name: Test (run in parallel) | |
| run: |- | |
| cd backend | |
| pipenv run coverage run --concurrency=multiprocessing manage.py test --settings=PennCourses.settings.ci --parallel | |
| pipenv run coverage combine | |
| - name: Upload Code Coverage | |
| run: |- | |
| ROOT=$(pwd) | |
| cd backend | |
| pipenv run codecov --root $ROOT --flags backend | |
| container: | |
| image: python:3.10-buster | |
| env: | |
| DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres | |
| services: | |
| postgres: | |
| image: postgres:12 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_DB: postgres | |
| POSTGRES_PASSWORD: postgres | |
| options: "--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5" | |
| publish-backend: | |
| name: Publish backend | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: docker/setup-qemu-action@v1 | |
| - uses: docker/setup-buildx-action@v1 | |
| - name: Cache Docker layers | |
| uses: actions/cache@v2 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: buildx-publish-backend | |
| - uses: docker/login-action@v1 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Build/Publish | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: backend | |
| file: backend/Dockerfile | |
| push: ${{ github.ref == 'refs/heads/master' }} | |
| cache-from: type=local,src=/tmp/.buildx-cache,type=registry,ref=pennlabs/penn-courses-backend:latest | |
| cache-to: type=local,dest=/tmp/.buildx-cache | |
| tags: pennlabs/penn-courses-backend:latest,pennlabs/penn-courses-backend:${{ github.sha }} | |
| needs: django-check | |
| react-check-pcp: | |
| name: React Check pcp | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Cache | |
| uses: actions/cache@v2 | |
| with: | |
| path: "**/node_modules" | |
| key: v0-${{ hashFiles('frontend/yarn.lock') }} | |
| - name: Install Dependencies | |
| run: |- | |
| cd frontend | |
| yarn install --frozen-lockfile | |
| - name: Lint | |
| run: |- | |
| cd frontend | |
| yarn lint | |
| - name: Test | |
| run: |- | |
| cd frontend | |
| yarn test | |
| - name: Upload Code Coverage | |
| run: |- | |
| ROOT=$(pwd) | |
| cd frontend | |
| yarn run codecov -p $ROOT -F frontend | |
| container: | |
| image: node:14 | |
| publish-frontend-pcp: | |
| name: Publish frontend-pcp | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: docker/setup-qemu-action@v1 | |
| - uses: docker/setup-buildx-action@v1 | |
| - name: Cache Docker layers | |
| uses: actions/cache@v2 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: buildx-publish-frontend-pcp | |
| - uses: docker/login-action@v1 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Build/Publish | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: frontend | |
| file: frontend/plan/Dockerfile | |
| push: ${{ github.ref == 'refs/heads/master' }} | |
| cache-from: type=local,src=/tmp/.buildx-cache,type=registry,ref=pennlabs/pcp-frontend:latest | |
| cache-to: type=local,dest=/tmp/.buildx-cache | |
| tags: pennlabs/pcp-frontend:latest,pennlabs/pcp-frontend:${{ github.sha }} | |
| needs: react-check-pcp | |
| react-check-pca: | |
| name: React Check pca | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Cache | |
| uses: actions/cache@v2 | |
| with: | |
| path: "**/node_modules" | |
| key: v0-${{ hashFiles('frontend/yarn.lock') }} | |
| - name: Install Dependencies | |
| run: |- | |
| cd frontend | |
| yarn install --frozen-lockfile | |
| - name: Lint | |
| run: |- | |
| cd frontend | |
| yarn lint | |
| - name: Test | |
| run: |- | |
| cd frontend | |
| yarn test | |
| - name: Upload Code Coverage | |
| run: |- | |
| ROOT=$(pwd) | |
| cd frontend | |
| yarn run codecov -p $ROOT -F frontend | |
| container: | |
| image: node:14 | |
| publish-frontend-pca: | |
| name: Publish frontend-pca | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: docker/setup-qemu-action@v1 | |
| - uses: docker/setup-buildx-action@v1 | |
| - name: Cache Docker layers | |
| uses: actions/cache@v2 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: buildx-publish-frontend-pca | |
| - uses: docker/login-action@v1 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Build/Publish | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: frontend | |
| file: frontend/alert/Dockerfile | |
| push: ${{ github.ref == 'refs/heads/master' }} | |
| cache-from: type=local,src=/tmp/.buildx-cache,type=registry,ref=pennlabs/pca-frontend:latest | |
| cache-to: type=local,dest=/tmp/.buildx-cache | |
| tags: pennlabs/pca-frontend:latest,pennlabs/pca-frontend:${{ github.sha }} | |
| needs: react-check-pca | |
| react-check-pcr: | |
| name: React Check pcr | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Cache | |
| uses: actions/cache@v2 | |
| with: | |
| path: "**/node_modules" | |
| key: v0-${{ hashFiles('frontend/yarn.lock') }} | |
| - name: Install Dependencies | |
| run: |- | |
| cd frontend | |
| yarn install --frozen-lockfile | |
| - name: Lint | |
| run: |- | |
| cd frontend | |
| yarn lint | |
| - name: Test | |
| run: |- | |
| cd frontend | |
| yarn test | |
| - name: Upload Code Coverage | |
| run: |- | |
| ROOT=$(pwd) | |
| cd frontend | |
| yarn run codecov -p $ROOT -F frontend | |
| container: | |
| image: node:14 | |
| publish-frontend-pcr: | |
| name: Publish frontend-pcr | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: docker/setup-qemu-action@v1 | |
| - uses: docker/setup-buildx-action@v1 | |
| - name: Cache Docker layers | |
| uses: actions/cache@v2 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: buildx-publish-frontend-pcr | |
| - uses: docker/login-action@v1 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Build/Publish | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: frontend | |
| file: frontend/review/Dockerfile | |
| push: ${{ github.ref == 'refs/heads/master' }} | |
| cache-from: type=local,src=/tmp/.buildx-cache,type=registry,ref=pennlabs/pcr-frontend:latest | |
| cache-to: type=local,dest=/tmp/.buildx-cache | |
| tags: pennlabs/pcr-frontend:latest,pennlabs/pcr-frontend:${{ github.sha }} | |
| needs: react-check-pcr | |
| publish-landing: | |
| name: Publish landing | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: docker/setup-qemu-action@v1 | |
| - uses: docker/setup-buildx-action@v1 | |
| - name: Cache Docker layers | |
| uses: actions/cache@v2 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: buildx-publish-landing | |
| - uses: docker/login-action@v1 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Build/Publish | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: frontend/landing | |
| file: frontend/landing/Dockerfile | |
| push: ${{ github.ref == 'refs/heads/master' }} | |
| cache-from: type=local,src=/tmp/.buildx-cache,type=registry,ref=pennlabs/pcx-landing:latest | |
| cache-to: type=local,dest=/tmp/.buildx-cache | |
| tags: pennlabs/pcx-landing:latest,pennlabs/pcx-landing:${{ github.sha }} | |
| deploy: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/master' | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - id: synth | |
| name: Synth cdk8s manifests | |
| run: |- | |
| cd k8s | |
| yarn install --frozen-lockfile | |
| # get repo name (by removing owner/organization) | |
| export RELEASE_NAME=${REPOSITORY#*/} | |
| # Export RELEASE_NAME as an output | |
| echo "::set-output name=RELEASE_NAME::$RELEASE_NAME" | |
| yarn build | |
| env: | |
| GIT_SHA: ${{ github.sha }} | |
| REPOSITORY: ${{ github.repository }} | |
| AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} | |
| - name: Deploy | |
| run: |- | |
| aws eks --region us-east-1 update-kubeconfig --name production --role-arn arn:aws:iam::${AWS_ACCOUNT_ID}:role/kubectl | |
| # get repo name from synth step | |
| RELEASE_NAME=${{ steps.synth.outputs.RELEASE_NAME }} | |
| # Deploy | |
| kubectl apply -f k8s/dist/ -l app.kubernetes.io/component=certificate | |
| kubectl apply -f k8s/dist/ --prune -l app.kubernetes.io/part-of=$RELEASE_NAME | |
| env: | |
| AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.GH_AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.GH_AWS_SECRET_ACCESS_KEY }} | |
| needs: | |
| - publish-backend | |
| - publish-frontend-pcp | |
| - publish-frontend-pca | |
| - publish-frontend-pcr | |
| - publish-landing |