Skip to content

Commit

Permalink
Merge pull request #20 from lsst-epo/EPO-8491
Browse files Browse the repository at this point in the history
Fixed syntax error in workflow file
  • Loading branch information
ericdrosas87 authored Sep 20, 2023
2 parents c1f7452 + 8cd416c commit 2a973bc
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 46 deletions.
37 changes: 12 additions & 25 deletions .github/workflows/develop-pr-gae.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'PR Preview to Int'
name: 'PR Preview to Dev'

on:
pull_request:
Expand All @@ -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) }}

Expand All @@ -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
Expand All @@ -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) }}
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/develop-push-gae.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
26 changes: 13 additions & 13 deletions .github/workflows/main-pr-gae.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Build Image on PR Creation to Int ~ Optional: Deploy Preview Instances'
name: 'PR Preview to Int'

on:
pull_request:
Expand Down Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/main-push-gae.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit 2a973bc

Please sign in to comment.