chore(deps): update dependency typescript to v5 #1701
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
name: Docker | |
on: | |
push: | |
jobs: | |
build: | |
name: "Build (${{ matrix.component }})" | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
component: [backend, frontend, next, postgres] | |
include: | |
- component: backend | |
name: cms-backend | |
- component: frontend | |
name: cms-frontend | |
- component: next | |
name: website-frontend | |
- component: postgres | |
name: cms-migrations | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: arm64 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log into registry ${{ env.REGISTRY }} | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GH_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: ${{ matrix.component }} | |
push: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }} | |
platforms: linux/amd64 | |
file: ${{ matrix.component }}/Dockerfile | |
tags: | | |
ghcr.io/csesoc/${{ matrix.name }}:${{ github.sha }} | |
ghcr.io/csesoc/${{ matrix.name }}:latest | |
labels: ${{ steps.meta.outputs.labels }} | |
deploy: | |
name: Deploy (CD) | |
runs-on: ubuntu-latest | |
needs: [build] | |
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }} | |
concurrency: staging | |
environment: | |
name: staging | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
repository: csesoc/deployment | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Install yq - portable yaml processor | |
uses: mikefarah/yq@v4.30.8 | |
- 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/cms/${{ github.sha }} | |
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/csesoc/cms-frontend:${{ github.sha }}"' apps/projects/cms/staging/deploy-cms-frontend.yml | |
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/csesoc/cms-backend:${{ github.sha }}"' apps/projects/cms/staging/deploy-cms-backend.yml | |
yq -i '.items[0].spec.template.spec.initContainers[0].image = "ghcr.io/csesoc/cms-migrations:${{ github.sha }}"' apps/projects/cms/staging/deploy-cms-backend.yml | |
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/csesoc/website-frontend:${{ github.sha }}"' apps/projects/cms/staging/deploy-website-frontend.yml | |
git add . | |
git commit -m "feat(cms/staging): update images" | |
git push -u origin update/cms/${{ github.sha }} | |
gh pr create --title "feat(cms/staging): update images" --body "Updates the images for the cms deployment to commit csesoc/cms.csesoc.unsw.edu.au@${{ github.sha }}." > URL | |
gh pr merge $(cat URL) --squash -d |