Skip to content

Deployment #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions .github/workflows/backend-ci.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: ci

on:
push:
branches:
- master
- renovate/*
pull_request:
branches:
- master

jobs:
api-ci:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 22
- run: npm ci
- run: npm run type-check
- run: npm run build
ui-ci:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install
- run: npm run lint
- run: npm run type-check
- run: npm run build
74 changes: 74 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Docker
on:
push:
branches:
- "master"

jobs:
build:
name: "Build (${{ matrix.component }})"
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: true
matrix:
component: [backend, frontend]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ${{ matrix.component }}
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64
file: ${{ matrix.component }}/Dockerfile
tags: |
ghcr.io/csesoc/website-${{ matrix.component }}:${{ github.sha }}
ghcr.io/csesoc/website-${{ matrix.component }}:latest
labels: ${{ steps.meta.outputs.labels }}
deploy-prod:
name: Deploy Production (CD)
runs-on: ubuntu-latest
needs: [build]
concurrency: prod
environment:
name: prod
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: csesoc/deployment
token: ${{ secrets.GH_TOKEN }}
ref: develop
- name: Install yq - portable yaml processor
uses: mikefarah/[email protected]
- name: Update deployment
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
git config user.name "CSESoc CD"
git config user.email "[email protected]"
git checkout -b update/website-prod/${{ github.sha }}
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/csesoc/website-backend:${{ github.sha }}"' apps/projects/website/prod/deploy-backend.yml
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/csesoc/website-frontend:${{ github.sha }}"' apps/projects/website/prod/deploy-frontend.yml
git add .
git commit -m "feat(website/prod): update image"
git push -u origin update/website-prod/${{ github.sha }}
gh pr create -B develop --title "feat(website/prod): update image" --body "Updates the image for the website-prod deployment to commit csesoc/csesoc-website@${{ github.sha }}." > URL
gh pr merge $(cat URL) --squash -d
35 changes: 0 additions & 35 deletions .github/workflows/frontend-ci.yml

This file was deleted.

Loading