diff --git a/.github/workflows/dev_deployment.yaml b/.github/workflows/dev_deployment.yaml index 3e3242a9..a4aaf2b5 100644 --- a/.github/workflows/dev_deployment.yaml +++ b/.github/workflows/dev_deployment.yaml @@ -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: @@ -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 @@ -44,6 +42,7 @@ 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 }} @@ -51,6 +50,7 @@ jobs: password: ${{ steps.auth.outputs.access_token }} - name: Build and Push Container + id: build shell: bash env: GAR_LOCATION: ${{ secrets.GAR_LOCATION }} @@ -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 @@ -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 \ No newline at end of file diff --git a/.github/workflows/uat_deployment.yaml b/.github/workflows/uat_deployment.yaml index c4a1b1cb..88592c62 100644 --- a/.github/workflows/uat_deployment.yaml +++ b/.github/workflows/uat_deployment.yaml @@ -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: @@ -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 }}' \ No newline at end of file + 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() diff --git a/Chart.yaml b/Chart.yaml index 5eb312c6..857572fc 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -1 +1 @@ -v0.0.0 \ No newline at end of file +v4.0.0 diff --git a/src/resources/auth/auth.route.js b/src/resources/auth/auth.route.js index 687959c4..fdc342f3 100644 --- a/src/resources/auth/auth.route.js +++ b/src/resources/auth/auth.route.js @@ -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