Skip to content

Commit 478839d

Browse files
committed
feat: migrate notangles deployment to devsoc-unsw organisation
1 parent a587040 commit 478839d

File tree

2 files changed

+19
-142
lines changed

2 files changed

+19
-142
lines changed

.github/workflows/docker-staging.yml

Lines changed: 0 additions & 126 deletions
This file was deleted.

.github/workflows/docker.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ on:
33
push:
44
branches:
55
- dev
6+
- staging
7+
8+
env:
9+
ENVIRONMENT: ${{ github.ref_name == 'dev' && 'prod' || 'staging' }}
10+
IMAGE_NAME: ${{ format('notangles{0}', github.ref_name == 'dev' && '' || '-staging') }}
611

712
jobs:
813
build-client:
@@ -44,8 +49,8 @@ jobs:
4449
SENTRY_TRACE_RATE_CLIENT=${{ secrets.SENTRY_TRACE_RATE_CLIENT }}
4550
GIT_COMMIT=${{ github.sha }}
4651
tags: |
47-
ghcr.io/csesoc/notangles-client:${{ github.sha }}
48-
ghcr.io/csesoc/notangles-client:latest
52+
ghcr.io/devsoc-unsw/${{ env.IMAGE_NAME }}-client:${{ github.sha }}
53+
ghcr.io/devsoc-unsw/${{ env.IMAGE_NAME }}-client:latest
4954
labels: ${{ steps.meta.outputs.labels }}
5055
build:
5156
name: 'Build (${{ matrix.component }})'
@@ -87,26 +92,24 @@ jobs:
8792
cache-from: type=gha
8893
cache-to: type=gha,mode=max
8994
tags: |
90-
ghcr.io/csesoc/notangles-${{ matrix.name }}:${{ github.sha }}
91-
ghcr.io/csesoc/notangles-${{ matrix.name }}:latest
95+
ghcr.io/devsoc-unsw/${{ env.IMAGE_NAME }}-${{ matrix.name }}:${{ github.sha }}
96+
ghcr.io/devsoc-unsw/${{ env.IMAGE_NAME }}-${{ matrix.name }}:latest
9297
labels: ${{ steps.meta.outputs.labels }}
9398
deploy:
9499
name: Deploy (CD)
95100
runs-on: ubuntu-latest
96101
needs: [build-client, build]
97102
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/dev' }}
98103
concurrency: production
99-
environment:
100-
name: production
101-
url: https://notangles.csesoc.app
104+
environment: production
102105

103106
steps:
104107
- name: Checkout repository
105108
uses: actions/checkout@v4
106109
with:
107-
repository: csesoc/deployment
110+
repository: devsoc-unsw/deployment
108111
token: ${{ secrets.GH_TOKEN }}
109-
ref: migration
112+
ref: dev
110113
- name: Install yq - portable yaml processor
111114
uses: mikefarah/[email protected]
112115
- name: Update deployment
@@ -115,12 +118,12 @@ jobs:
115118
run: |
116119
git config user.name "CSESoc CD"
117120
git config user.email "[email protected]"
118-
git checkout -b update/notangles/${{ github.sha }}
119-
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/csesoc/notangles-client:${{ github.sha }}"' projects/notangles/deploy-frontend.yml
120-
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/csesoc/notangles-backend:${{ github.sha }}"' projects/notangles/deploy-backend.yml
121-
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/csesoc/notangles-auto-timetabler-server:${{ github.sha }}"' projects/notangles/deploy-auto-timetabler.yml
121+
git checkout -b update/${{ env.IMAGE_NAME }}/${{ github.sha }}
122+
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/devsoc-unsw/${{ env.IMAGE_NAME }}-client:${{ github.sha }}"' projects/notangles/${{ env.ENVIRONMENT }}/deploy-frontend.yml
123+
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/devsoc-unsw/${{ env.IMAGE_NAME }}-backend:${{ github.sha }}"' projects/notangles/${{ env.ENVIRONMENT }}/deploy-backend.yml
124+
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/devsoc-unsw/${{ env.IMAGE_NAME }}-auto-timetabler-server:${{ github.sha }}"' projects/notangles/${{ env.ENVIRONMENT }}/deploy-auto-timetabler.yml
122125
git add .
123-
git commit -m "feat(notangles): update images"
124-
git push -u origin update/notangles/${{ github.sha }}
125-
gh pr create -B migration --title "feat(notangles): update images" --body "Updates the images for the notangles deployment to commit csesoc/notangles@${{ github.sha }}." > URL
126+
git commit -m "feat(${{ env.IMAGE_NAME }}): update images"
127+
git push -u origin update/${{ env.IMAGE_NAME }}/${{ github.sha }}
128+
gh pr create -B dev --title "feat(${{ env.IMAGE_NAME }}): update images" --body "Updates the images for the ${{ env.IMAGE_NAME }} deployment to commit devsoc-unsw/${{ env.IMAGE_NAME }}@${{ github.sha }}." > URL
126129
gh pr merge $(cat URL) --squash -d

0 commit comments

Comments
 (0)