Skip to content

ENV Ephemeral: create #6

ENV Ephemeral: create

ENV Ephemeral: create #6

# Copyright (C) 2022 Dynamic Solutions
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: 'ENV Ephemeral: create'
permissions:
id-token: write
on:
workflow_dispatch:
env:
APP_FRONTEND_MODULE: application/frontend
E2E_TESTS_MODULE: tests/end-to-end
jobs:
create-ephemeral-env:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v1
with:
token_format: access_token
workload_identity_provider: ${{ vars.GCP_DEV_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ vars.GCP_DEV_SERVICE_ACCOUNT_EMAIL }}
- name: Deploy new Cloud Run environment
run: |
CLOUD_RUN_ENV_NAME=$(./.github/scripts/get-cloud-run-env-name.sh ${{ github.ref_name }})
gcloud run deploy $CLOUD_RUN_ENV_NAME --source=. \
--update-secrets=/run/secrets/admin.password=websight-admin-password:1 \
--cpu=2 --memory=2Gi --no-cpu-throttling \
--min-instances=1 --max-instances=1 \
--allow-unauthenticated --region=${{ vars.GCP_DEFAULT_REGION }} \
--quiet