Skip to content

Commit

Permalink
Merge pull request #969 from HDRUK/release
Browse files Browse the repository at this point in the history
GAT-2050: GAT Live Release - v4.0.0
  • Loading branch information
reubensamuel authored Feb 28, 2023
2 parents 3cd8997 + 0184bae commit 5dd5454
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 10 deletions.
34 changes: 27 additions & 7 deletions .github/workflows/dev_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ name: Build and Deploy to Cloud Run

on:
push:
branches:
- 'dev'
paths:
- 'Chart.yaml'
- 'Chart.yaml'

env:
PROJECT_ID: '${{ secrets.PROJECT_ID }}' # TODO: update Google Cloud project id.
GAR_LOCATION: '${{ secrets.GAR_LOCATION }}' # TODO: update Artifact Registry location
SLACK_WEBHOOK_URL: '${{ secrets.SLACK_WEBHOOK_URL}}'
SLACK_CHANNEL: '${{ secrets.GITHUBACTIONS_SLACK_CHANNEL }}'

jobs:
build:
Expand All @@ -28,12 +32,6 @@ jobs:
- name: Read VERSION file
id: getversion
run: echo "version=$(cat Chart.yaml)" >> $GITHUB_OUTPUT
# Used for production
# - uses: "marvinpinto/action-automatic-releases@latest"
# with:
# repo_token: "${{ secrets.GITHUB_TOKEN }}"
# automatic_release_tag: ${{ steps.getversion.outputs.version }}
# prerelease: false

- name: Google Auth
id: auth
Expand All @@ -44,13 +42,15 @@ jobs:
service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}'

- name: Login to GAR
id: garlogin
uses: docker/login-action@v2
with:
registry: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.PROJECT_ID }}
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}

- name: Build and Push Container
id: build
shell: bash
env:
GAR_LOCATION: ${{ secrets.GAR_LOCATION }}
Expand All @@ -60,6 +60,16 @@ jobs:
run: |-
docker build -t '${{ env.GAR_LOCATION }}'-docker.pkg.dev/'${{ env.PROJECT_ID }}'/'${{ env.GAR_NAME }}'/${{ steps.getversion.outputs.version }}:${{ github.sha }} -t '${{ env.GAR_LOCATION }}'-docker.pkg.dev/'${{ env.PROJECT_ID }}'/'${{ env.GAR_NAME }}'/${{ steps.getversion.outputs.version }}:latest ./
docker push --all-tags '${{ env.GAR_LOCATION }}'-docker.pkg.dev/'${{ env.PROJECT_ID }}'/'${{ env.GAR_NAME }}'/${{ steps.getversion.outputs.version }}
- name: Build Notification
id: buildnotificationsent
uses: act10ns/slack@v1
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: ${{ env.SLACK_CHANNEL }}
message: Building {{ env.GITHUB_REF_NAME }} branch
if: always()
# END - Docker auth and build


Expand Down Expand Up @@ -135,4 +145,14 @@ jobs:

with:
args: run services update '${{ env.SERVICE_NAME }}' --image='${{ env.GAR_LOCATION }}'-docker.pkg.dev/'${{ env.PROJECT_ID }}'/'${{ env.GAR_NAME }}'/${{ steps.getversion.outputs.version }}:${{ github.sha }} --region='${{ env.SERVICE_REGION }}' --project='${{ env.PROJECT_ID }}'

- name: Deploy Notification
id: deploynotificationsent
uses: act10ns/slack@v1
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: ${{ env.SLACK_CHANNEL }}
message: Deploying {{ env.GITHUB_REF_NAME }} branch
if: always()
# If required, use the Cloud Run url output in later steps
14 changes: 13 additions & 1 deletion .github/workflows/uat_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
env:
PROJECT_ID: '${{ secrets.PROJECT_ID }}' # TODO: update Google Cloud project id.
GAR_LOCATION: '${{ secrets.GAR_LOCATION }}' # TODO: update Artifact Registry location
SLACK_WEBHOOK_URL: '${{ secrets.SLACK_WEBHOOK_URL}}'
SLACK_CHANNEL: '${{ secrets.GITHUBACTIONS_SLACK_CHANNEL }}'

jobs: # Deployment please don't modify anything here as the infrastructure is controlled by terraform any changes here please agree with chris and reuben.
# catchsha:
Expand Down Expand Up @@ -60,4 +62,14 @@ jobs: # Deployment please don't modify anything here as the infrastructure
with:
# args: run services update '${{ env.SERVICE_NAME }}' --image='${{ env.GAR_LOCATION }}'-docker.pkg.dev/'${{ env.DEV_PROJECT_ID }}'/'${{ env.GAR_NAME }}'/${{ steps.getversion.outputs.version }}:{{ steps.catchsha.outputs.GITHUB_SHA}} --region='${{ env.SERVICE_REGION }}' --project='${{ env.PROJECT_ID }}'
# Functionality not supported by Github Actions one to ccheck back agin in the future
args: run services update '${{ env.SERVICE_NAME }}' --image='${{ env.GAR_LOCATION }}'-docker.pkg.dev/'${{ env.DEV_PROJECT_ID }}'/'${{ env.GAR_NAME }}'/${{ steps.getversion.outputs.version }}:latest --region='${{ env.SERVICE_REGION }}' --project='${{ env.PROJECT_ID }}'
args: run services update '${{ env.SERVICE_NAME }}' --image='${{ env.GAR_LOCATION }}'-docker.pkg.dev/'${{ env.DEV_PROJECT_ID }}'/'${{ env.GAR_NAME }}'/${{ steps.getversion.outputs.version }}:latest --region='${{ env.SERVICE_REGION }}' --project='${{ env.PROJECT_ID }}'

- name: Deploy Notification
id: deploynotificationsent
uses: act10ns/slack@v1
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: ${{ env.SLACK_CHANNEL }}
message: Deploying {{ env.GITHUB_REF_NAME }} branch
if: always()
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.0.0
v4.0.0
2 changes: 1 addition & 1 deletion src/resources/auth/auth.route.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ router.get('/status', function (req, res, next) {
if (err || !user) {
return res.json({
success: true,
data: [{ role: 'Reader', id: null, name: null, loggedIn: false, tempProp: true }],
data: [{ role: 'Reader', id: null, name: null, loggedIn: false }],
});
} else {
// 1. Reformat teams array for frontend
Expand Down

0 comments on commit 5dd5454

Please sign in to comment.