Merge pull request #20 from lsst-epo/EPO-8491 #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Push to Development after PR Merge' | |
on: | |
push: | |
branches: | |
- 'develop' | |
jobs: | |
build-push-deploy: | |
name: 'Deploy Development Version' | |
runs-on: ubuntu-latest | |
if: ${{ github.event.action != 'closed'}} | |
# Checkout the repository to the GitHub Actions runner | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# gcloud CLI setup | |
- name: Login to GCP | |
uses: google-github-actions/setup-gcloud@v0 | |
with: | |
service_account_key: ${{ secrets.DEV_SA_KEY }} | |
project_id: skyviewer | |
export_default_credentials: true | |
- name: Get app.yaml | |
run: gcloud secrets versions access latest --secret=investigations-api-appyaml > app.yaml | |
- name: Format version name | |
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 `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 | |