Skip to content

Feature: Changed dark mode settings toggle to icon button in sidebar … #45

Feature: Changed dark mode settings toggle to icon button in sidebar …

Feature: Changed dark mode settings toggle to icon button in sidebar … #45

name: Docker (Staging)
on:
push:
branches:
- staging
jobs:
build-client:
name: 'Build (Client)'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
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: client
push: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/staging' }}
platforms: linux/amd64
file: client/Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
FACEBOOK_APP_ID=${{ secrets.FACEBOOK_APP_ID }}
GOOGLE_ANALYTICS_ID=${{ secrets.GOOGLE_ANALYTICS_ID }}
GOOGLE_API_KEY=${{ secrets.GOOGLE_API_KEY }}
GOOGLE_OAUTH_CLIENT_ID=${{ secrets.GOOGLE_OAUTH_CLIENT_ID }}
SENTRY_INGEST_CLIENT=${{ secrets.SENTRY_INGEST_CLIENT }}
SENTRY_TRACE_RATE_CLIENT=${{ secrets.SENTRY_TRACE_RATE_CLIENT }}
tags: |
ghcr.io/csesoc/notangles-client:${{ github.sha }}
ghcr.io/csesoc/notangles-client:latest
labels: ${{ steps.meta.outputs.labels }}
build:
name: 'Build (${{ matrix.component }})'
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
component: [server, auto_server]
include:
- component: server
name: backend
- component: auto_server
name: auto-timetabler-server
permissions:
contents: read
packages: write
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' && github.ref == 'refs/heads/staging' }}
platforms: linux/amd64
file: ${{ matrix.component }}/Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
ghcr.io/csesoc/notangles-${{ matrix.name }}:${{ github.sha }}
ghcr.io/csesoc/notangles-${{ matrix.name }}:latest
labels: ${{ steps.meta.outputs.labels }}
deploy:
name: Deploy (CD)
runs-on: ubuntu-latest
needs: [build-client, build]
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/staging' }}
concurrency: staging
environment:
name: staging
url: https://notanglesstaging.devsoc.app
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: csesoc/deployment
token: ${{ secrets.GH_TOKEN }}
ref: migration
- name: Install yq - portable yaml processor
uses: mikefarah/yq@v4.43.1
- name: Update deployment
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
git config user.name "CSESoc CD"
git config user.email "technical@csesoc.org.au"
git checkout -b update/notangles-staging/${{ github.sha }}
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/csesoc/notangles-client:${{ github.sha }}"' projects/notangles-staging/deploy-frontend.yml
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/csesoc/notangles-backend:${{ github.sha }}"' projects/notangles-staging/deploy-backend.yml
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/csesoc/notangles-auto-timetabler-server:${{ github.sha }}"' projects/notangles-staging/deploy-auto-timetabler.yml
git add .
git commit -m "feat(notangles_staging): update images"
git push -u origin update/notangles-staging/${{ github.sha }}
gh pr create -B migration --title "feat(notangles_staging): update images" --body "Updates the images for the notangles_staging deployment to commit csesoc/notangles-staging@${{ github.sha }}." > URL
gh pr merge $(cat URL) --squash -d