diff --git a/.github/workflows/develop-pr-gae.yaml b/.github/workflows/develop-pr-gae.yaml index 7a69352..ca987a1 100644 --- a/.github/workflows/develop-pr-gae.yaml +++ b/.github/workflows/develop-pr-gae.yaml @@ -1,4 +1,4 @@ -name: 'PR Preview to Int' +name: 'PR Preview to Dev' on: pull_request: @@ -12,7 +12,7 @@ on: jobs: build-push-deploy: - name: 'Build and Deploy PR Preview to Integration' + name: 'Build and Deploy PR Preview to Development' runs-on: ubuntu-latest if: ${{ (github.event.action != 'closed') && (startsWith(github.head_ref, 'preview') == false) }} @@ -35,15 +35,7 @@ jobs: id: version_name run: echo "version_name=$(echo \"${{ github.head_ref }}\" | tr -cd '[:alnum:]' | tr '[:upper:]' '[:lower:]' | tr -d 'preview')" >> $GITHUB_ENV - - name: Deploy to App Engine - env: - BRANCH_NAME: ${{ env.version_name }} - run: | - gcloud app deploy app.yaml \ - --no-promote \ - --version=${BRANCH_NAME,,} - - # Create or update a comment with the URL + # Create or update a comment with the secrets reminder - name: Find Comment uses: peter-evans/find-comment@v1 id: fc @@ -58,24 +50,19 @@ jobs: comment-id: ${{ steps.fc.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} body: | - :orangutan: IMPORTANT! If this PR requires updated secrets, please ensure they are updated in the dev environment in GCP! :orangutan: + :orangutan: IMPORTANT! If this PR requires updated secrets, please ensure they are updated in the `dev` environment in GCP! :orangutan: reactions: '+1' edit-mode: replace - - # - name: Get secret to create .env - # run: gcloud secrets versions access latest --secret=investigations-api-env > ./api/.env - - # - name: Setup docker build - # uses: docker/setup-buildx-action@v2 - # id: buildx - # with: - # install: true - - # - name: Build client, but don't deploy - # run: docker build . + - name: Deploy to App Engine + env: + BRANCH_NAME: ${{ env.version_name }} + run: | + gcloud app deploy app.yaml \ + --no-promote \ + --version=${BRANCH_NAME,,} - build-push-deploy: + build-push-deploy-with-preview: name: 'Build Image and Deploy Preview Version' runs-on: ubuntu-latest if: ${{ (github.event.action != 'closed') && (startsWith(github.head_ref, 'preview') == true) }} diff --git a/.github/workflows/develop-push-gae.yaml b/.github/workflows/develop-push-gae.yaml index 69ea3c3..96005e3 100644 --- a/.github/workflows/develop-push-gae.yaml +++ b/.github/workflows/develop-push-gae.yaml @@ -31,13 +31,6 @@ jobs: id: version_name run: echo "version_name=$(echo \"${{ github.head_ref }}\" | sed 's/[_.,\/]/-/g' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - - name: Deploy to App Engine - env: - BRANCH_NAME: ${{ env.version_name }} - run: | - gcloud app deploy app.yaml \ - --promote - - name: Find Comment uses: peter-evans/find-comment@v1 id: fc @@ -52,7 +45,15 @@ jobs: comment-id: ${{ steps.fc.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} body: | - :orangutan: IMPORTANT! If this PR requires updated secrets, please ensure they are updated in the dev environment in GCP! :orangutan: + :orangutan: IMPORTANT! If this PR requires updated secrets, please ensure they are updated in the `dev` environment in GCP! :orangutan: reactions: '+1' edit-mode: replace + + - name: Deploy to App Engine + env: + BRANCH_NAME: ${{ env.version_name }} + run: | + gcloud app deploy app.yaml \ + --promote + \ No newline at end of file diff --git a/.github/workflows/main-pr-gae.yaml b/.github/workflows/main-pr-gae.yaml index 31dcb2c..32aa1aa 100644 --- a/.github/workflows/main-pr-gae.yaml +++ b/.github/workflows/main-pr-gae.yaml @@ -1,4 +1,4 @@ -name: 'Build Image on PR Creation to Int ~ Optional: Deploy Preview Instances' +name: 'PR Preview to Int' on: pull_request: @@ -66,33 +66,33 @@ jobs: id: version_name run: echo "version_name=$(echo \"${{ github.head_ref }}\" | tr -cd '[:alnum:]' | tr '[:upper:]' '[:lower:]' | tr -d 'preview')" >> $GITHUB_ENV - - name: Deploy to App Engine - env: - BRANCH_NAME: ${{ env.version_name }} - run: | - gcloud app deploy app.yaml \ - --no-promote \ - --version=${BRANCH_NAME,,} - - # Create or update a comment with the URL + # Create or update a comment with the secrets reminder - name: Find Comment uses: peter-evans/find-comment@v1 id: fc with: issue-number: ${{ github.event.pull_request.number }} comment-author: 'github-actions[bot]' - body-includes: A preview of this PR + body-includes: IMPORTANT! If this PR requires updated secrets - - name: Create or update a comment with the URL to the PR + - name: Create or update a comment with reminder for secrets update uses: peter-evans/create-or-update-comment@v1 with: comment-id: ${{ steps.fc.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} body: | - A purreview of this PR will be available at https://${{ github.head_ref }}-dot-investigations-api-dot-skyviewer.uw.r.appspot.com until the request is closed. :cat2: + :orangutan: IMPORTANT! If this PR requires updated secrets, please ensure they are updated in the `int` environment in GCP! :orangutan: reactions: '+1' edit-mode: replace + - name: Deploy to App Engine + env: + BRANCH_NAME: ${{ env.version_name }} + run: | + gcloud app deploy app.yaml \ + --no-promote \ + --version=${BRANCH_NAME,,} + cleanup: name: 'Cleanup PR Preview' runs-on: ubuntu-latest diff --git a/.github/workflows/main-push-gae.yaml b/.github/workflows/main-push-gae.yaml index ce25b11..5fc4329 100644 --- a/.github/workflows/main-push-gae.yaml +++ b/.github/workflows/main-push-gae.yaml @@ -31,6 +31,24 @@ jobs: id: version_name run: echo "version_name=$(echo \"${{ github.head_ref }}\" | sed 's/[_.,\/]/-/g' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + - name: Find Comment + uses: peter-evans/find-comment@v1 + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: IMPORTANT! If this PR requires updated secrets + + - name: Create or update a comment with reminder for secrets update + uses: peter-evans/create-or-update-comment@v1 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body: | + :orangutan: IMPORTANT! If this PR requires updated secrets, please ensure they are updated in the `int` environment in GCP! :orangutan: + reactions: '+1' + edit-mode: replace + - name: Deploy to App Engine env: BRANCH_NAME: ${{ env.version_name }}