Skip to content

Commit

Permalink
Add GAE deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
weak-kajuma committed Sep 7, 2023
1 parent 4f48f22 commit 81a7678
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file specifies files that are *not* uploaded to Google Cloud
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore

# Node.js dependencies:
node_modules/
35 changes: 35 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: deploy
on:
push:
branches:
- 'master'
- 'development'

jobs:
deplay-staging:
name: GAE deplay
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Copy product.app.yaml
if: github.ref == 'refs/heads/master'
run: |
cp product.app.yaml app.yaml
echo ${{ secrets.PRODUCT_SECRET }} | base64 -d > secret.yaml
- name: Copy develop.app.yaml
if: github.ref == 'refs/heads/development'
run: |
cp develop.app.yaml app.yaml
echo ${{ secrets.DEVELOP_SECRET }} | base64 -d > secret.yaml
- name: Deploy an App Engine app
id: deploy-app
uses: google-github-actions/deploy-appengine@v0.3.1
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
deliverables: app.yaml
credentials: ${{ secrets.GCP_SA_KEY }}
version: v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
dist/
.env
secret.yaml
10 changes: 10 additions & 0 deletions develop.app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
service: development
runtime: nodejs16
instance_class: F1

automatic_scaling:
max_instances: 1
min_instances: 0

includes:
- secret.yaml
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"name": "kra-seller-api",
"version": "1.0.0",
"description": "",
"main": "api/main.js",
"main": "dist/main.js",
"scripts": {
"start": "node api/main.js",
"start": "node dist/main.js",
"start:prod": "tsc && node dist/main.js",
"build": "tsc",
"dev": "nodemon"
},
Expand Down
9 changes: 9 additions & 0 deletions product.app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
runtime: nodejs16
instance_class: F1

automatic_scaling:
max_instances: 1
min_instances: 0

includes:
- secret.yaml
Empty file added sample.secret.yaml
Empty file.

0 comments on commit 81a7678

Please sign in to comment.