Skip to content

Commit 8e1098b

Browse files
committed
github action to deploy
1 parent 0588502 commit 8e1098b

File tree

3 files changed

+46
-4
lines changed

3 files changed

+46
-4
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build and deploy to Google AppEngine
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
# Environment variables available to all jobs and steps in this workflow
9+
env:
10+
PROJECT_ID: ${{ secrets.GCP_PROJECT }}
11+
12+
jobs:
13+
setup-build-deploy:
14+
name: Setup, Build, and Deploy
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v1
20+
21+
# Setup gcloud CLI
22+
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
23+
with:
24+
version: '275.0.0'
25+
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
26+
service_account_key: ${{ secrets.GCP_SA_KEY }}
27+
28+
- name: Install yq
29+
run: sudo snap install yq
30+
31+
- name: Set COMMIT
32+
run: |
33+
yq write --inplace ./app.yaml env_variables.COMMIT ${GITHUB_SHA:0:7}
34+
35+
- name: Set LASTMODIFIED
36+
run: |
37+
yq write --inplace ./app.yaml env_variables.LASTMOD "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
38+
39+
- name: Deploy to AppEngine
40+
run: |
41+
gcloud app deploy --project=${PROJECT_ID} --quiet

app.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
application: regexplanet-go
2-
version: 2
31
runtime: go113
42
handlers:
53
- url: /favicon.ico
@@ -12,8 +10,8 @@ handlers:
1210
static_files: robots.txt
1311
upload: robots.txt
1412
- url: /.*
15-
script: _go_app
13+
script: auto
1614
env_variables:
1715
COMMIT: dev
1816
LASTMOD: dev
19-
main: ./web
17+
main: src/regexplanet.go

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/regexplanet/regexplanet-go
2+
3+
go 1.13

0 commit comments

Comments
 (0)