Skip to content

try to rename migrations folder #302

try to rename migrations folder

try to rename migrations folder #302

Workflow file for this run

name: Docker
on:
push:
branches:
- "develop"
- "main"
jobs:
build:
name: "Build (${{ matrix.component }})"
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: true
matrix:
component: [backend, frontend, migration]
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/unilectives-${{ matrix.component }}:${{ github.sha }}
ghcr.io/csesoc/unilectives-${{ matrix.component }}:latest
labels: ${{ steps.meta.outputs.labels }}
deploy-staging:
name: Deploy Staging (CD)
runs-on: ubuntu-latest
needs: [build]
concurrency: staging
environment:
name: staging
url: https://cselectives.staging.csesoc.unsw.edu.au
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/develop' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: csesoc/deployment
token: ${{ secrets.GH_TOKEN }}
- 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/unilectives-staging/${{ github.sha }}
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/csesoc/unilectives-backend:${{ github.sha }}"' apps/projects/unilectives/staging/deploy-backend.yml
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/csesoc/unilectives-frontend:${{ github.sha }}"' apps/projects/unilectives/staging/deploy-frontend.yml
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/csesoc/unilectives-migration:${{ github.sha }}"' apps/projects/unilectives/staging/deploy-migration.yml
git add .
git commit -m "feat(cselectives/staging): update image"
git push -u origin update/unilectives-staging/${{ github.sha }}
gh pr create --title "feat(cselectives/staging): update image" --body "Updates the image for the cselectives v2 (staging) deployment to commit csesoc/cselectives-v2@${{ github.sha }}." > URL
gh pr merge $(cat URL) --squash -d
deploy-prod:
name: Deploy Production (CD)
runs-on: ubuntu-latest
needs: [build]
concurrency: prod
environment:
name: prod
url: https://unilectives.csesoc.app
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 }}
- 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/unilectives-prod/${{ github.sha }}
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/csesoc/unilectives-backend:${{ github.sha }}"' apps/projects/unilectives/prod/deploy-backend.yml
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/csesoc/unilectives-frontend:${{ github.sha }}"' apps/projects/unilectives/prod/deploy-frontend.yml
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/csesoc/unilectives-migration:${{ github.sha }}"' apps/projects/unilectives/prod/deploy-migration.yml
git add .
git commit -m "feat(unilectives/prod): update image"
git push -u origin update/unilectives-prod/${{ github.sha }}
gh pr create --title "feat(unilectives/prod): update image" --body "Updates the image for the unilectives v2 (prod) deployment to commit csesoc/cselectives-v2@${{ github.sha }}." > URL
gh pr merge $(cat URL) --squash -d