Skip to content

ENV Ephemeral: destroy #1

ENV Ephemeral: destroy

ENV Ephemeral: destroy #1

# 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: destroy'
permissions:
id-token: write
on:
workflow_dispatch:
jobs:
destroy-ephemeral-env:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- 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: Destroy Cloud Run service
run: |
export ENV_NAME_POSTFIX=$(echo ${{ github.ref_name }} | sed 's/[^a-zA-Z0-9]/-/g' | cut -c 1-40)
gcloud run services delete -q websight-cms-$ENV_NAME_POSTFIX --region=${{ vars.GCP_DEFAULT_REGION }}