Skip to content

Commit

Permalink
Merge pull request #58 from lsst-epo/develop
Browse files Browse the repository at this point in the history
GAE Migration
  • Loading branch information
ericdrosas87 authored Jul 15, 2024
2 parents 61b8b3e + 29e37d8 commit ec9f9a4
Show file tree
Hide file tree
Showing 120 changed files with 623 additions and 15,211 deletions.
34 changes: 34 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
ENVIRONMENT=dev
APP_ID=
SECURITY_KEY=
CP_TRIGGER=admin

# For Craft Postgres DB
DB_DRIVER=pgsql
DB_SERVER=db
DB_PORT=5432
DB_DATABASE=
DB_USER=
DB_PASSWORD=
DB_SCHEMA=public

ENABLE_MEMCACHED=true
MEMCACHED_IP=cache
MEMCACHED_PORT=11211

# For required and custom Craft aliases
PRIMARY_SITE_URL=http://localhost:8080
WEB_BASE_URL=http://localhost:3000
ALIAS_PREVIEW_URL_FORMAT=http://localhost:3000/api/preview?site={site}&entryUid={sourceUid}

# For Canto Assets
CANTO_APP_ID=
CANTO_SECRET_KEY=
CANTO_AUTH_ENDPOINT=https://oauth.canto.com/oauth/api/oauth2/token?app_id={appId}&app_secret={secretKey}&grant_type=client_credentials&refresh_token=
CANTO_ASSET_ENDPOINT=<YOUR CANTO URL>/api/v1/image/
CANTO_ASSET_BASEURL=<YOUR CANTO URL>/direct/


# For Google Storage Assets
GCP_PROJECT_ID=skyviewer
GCS_ASSET_BUCKET=
39 changes: 39 additions & 0 deletions .github/workflows/gae-develop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Deploy to Dev'

on:
push:
branches:
- 'develop'

jobs:
build-push-deploy:
name: 'Build and Deploy to Development'
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=skyviewer-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: Deploy to App Engine
env:
BRANCH_NAME: ${{ env.version_name }}
run: |
gcloud app deploy app.yaml \
--promote
37 changes: 37 additions & 0 deletions .github/workflows/gae-master.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Builds, pushes, and deploys the Skyviewer API container
name: 'Deploy Skyviewer API to Int'

on:
push:
branches:
- 'master'

jobs:
build-push-deploy:
name: 'Build, Publish, and Deploy'
runs-on: ubuntu-latest

# 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.SKYVIEWER_INT_SERVICE_ACCOUNT }}
project_id: edc-int-6c5e
export_default_credentials: true

- name: Get app.yaml
run: gcloud secrets versions access latest --secret=skyviewer-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: Deploy to App Engine
run: |-
gcloud app deploy app.yaml \
--promote
40 changes: 40 additions & 0 deletions .github/workflows/gae-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 'Deploy to Production'

on:
push:
branches:
- '!*'
tags:
- 'v*'

jobs:
build-push-deploy:
name: 'Build and Deploy to Production'
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.PIPELINE_EPO_PROD_PROJECT }}
project_id: edc-prod-eef0
export_default_credentials: true

- name: Get app.yaml
run: gcloud secrets versions access latest --secret=skyviewer-api-appyaml > app.yaml

- name: Format version name
id: version_name
run: echo "version_name=$(echo \"${{ github.ref_name }}\" | sed 's/[_.,\/]/-/g' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Deploy to App Engine
run: |
gcloud app deploy app.yaml \
--version=${{ env.version_name }} \
--promote
98 changes: 0 additions & 98 deletions .github/workflows/master-pr.yaml

This file was deleted.

56 changes: 0 additions & 56 deletions .github/workflows/master-push.yaml

This file was deleted.

Loading

0 comments on commit ec9f9a4

Please sign in to comment.