use updated frontend check #861
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
# ======================================== | |
# Note: If you make changes to this CI/CD, please include someone from DevOps in the list of reviewers for the PR. | |
# ======================================== | |
name: Build and Deploy Clubs | |
on: push | |
jobs: | |
backend-check: | |
name: "Backend Check" | |
uses: pennlabs/shared-actions/.github/workflows/django.yaml@507f4cf1cc88259fc8625fb3a35bd3f18fc91cd5 | |
secrets: inherit | |
with: | |
projectName: pennclubs | |
path: backend | |
pythonVersion: 3.11-bookworm | |
flake: false | |
black: false | |
ruff: true | |
frontend-check-and-publish: | |
name: "Frontend Check and Publish" | |
uses: pennlabs/shared-actions/.github/workflows/react.yaml@e858b500d76e8e45523c64a0363a290f2aba3f4b | |
with: | |
imageName: penn-clubs-frontend | |
githubRef: ${{ github.ref }} | |
gitSha: ${{ github.sha }} | |
path: frontend | |
nodeVersion: 20.11.1 | |
dockerfile: frontend/Dockerfile | |
skipCodecov: true | |
secrets: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
build-backend: | |
name: Build 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-build-backend | |
- name: Build/Publish | |
uses: docker/build-push-action@v2 | |
with: | |
context: backend | |
file: backend/Dockerfile | |
push: false | |
cache-from: type=local,src=/tmp/.buildx-cache,type=registry,ref=pennlabs/penn-clubs-backend:latest | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
tags: pennlabs/penn-clubs-backend:latest,pennlabs/penn-clubs-backend:${{ github.sha }} | |
outputs: type=docker,dest=/tmp/image.tar | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: build-backend | |
path: /tmp/image.tar | |
needs: backend-check | |
publish-backend: | |
name: Publish Backend Image | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v4 | |
- uses: geekyeggo/delete-artifact@v5 | |
with: | |
name: build-backend | |
- name: Load docker image | |
run: docker load --input build-backend/image.tar | |
- uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Push docker image | |
run: docker push -a pennlabs/penn-clubs-backend | |
needs: | |
- build-backend | |
deploy: | |
name: "Deploy" | |
uses: pennlabs/shared-actions/.github/workflows/[email protected] | |
with: | |
githubRef: ${{ github.ref }} | |
gitSha: ${{ github.sha }} | |
secrets: | |
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} | |
GH_AWS_ACCESS_KEY_ID: ${{ secrets.GH_AWS_ACCESS_KEY_ID }} | |
GH_AWS_SECRET_ACCESS_KEY: ${{ secrets.GH_AWS_SECRET_ACCESS_KEY }} | |
needs: | |
- frontend-check-and-publish | |
- publish-backend |