Skip to content

Commit

Permalink
Merge pull request #22 from lsst-epo/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ericdrosas87 authored Sep 20, 2023
2 parents 1bd8feb + 9ec5d02 commit 4cf015c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 37 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/develop-pr-gae.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Build Image on PR Creation ~ Optional: Deploy Preview Instances'
name: 'PR Preview to Dev'

on:
pull_request:
Expand All @@ -11,8 +11,8 @@ on:
- 'develop'

jobs:
build-image-no-deploy:
name: 'Build Image Without Deploy - No Preview'
build-push-deploy:
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 @@ -28,20 +28,22 @@ jobs:
service_account_key: ${{ secrets.DEV_SA_KEY }}
project_id: skyviewer
export_default_credentials: true

- name: Get secret to create .env
run: gcloud secrets versions access latest --secret=investigations-api-env > ./api/.env
- name: Get app.yaml
run: gcloud secrets versions access latest --secret=rubin-obs-api-appyaml > app.yaml

- name: Setup docker build
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Format version name
id: version_name
run: echo "version_name=$(echo \"${{ github.head_ref }}\" | tr -cd '[:alnum:]' | tr '[:upper:]' '[:lower:]' | tr -d 'preview')" >> $GITHUB_ENV

- 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
3 changes: 2 additions & 1 deletion .github/workflows/develop-push-gae.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ jobs:
- name: Format version name
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
21 changes: 1 addition & 20 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 @@ -74,25 +74,6 @@ jobs:
--no-promote \
--version=${BRANCH_NAME,,}
# Create or update a comment with the URL
- 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

- name: Create or update a comment with the URL to the PR
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:
reactions: '+1'
edit-mode: replace

cleanup:
name: 'Cleanup PR Preview'
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main-push-gae.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Push to Development after PR Merge'
name: 'Push to Integration upon force push'

on:
push:
Expand All @@ -7,7 +7,7 @@ on:

jobs:
build-push-deploy:
name: 'Deploy Development Version'
name: 'Deploy Integration Version'
runs-on: ubuntu-latest
if: ${{ github.event.action != 'closed'}}

Expand Down

0 comments on commit 4cf015c

Please sign in to comment.