-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1.06 KB
/
main-release-tag.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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=investigations-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