[scraper] deploy to google app engine

This commit is contained in:
TheBeastLT
2020-03-13 20:00:26 +01:00
parent 81236297c1
commit 19052cc366
3 changed files with 34 additions and 1 deletions

28
.github/workflows/deploy-pipeline.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: Deploy Pipeline
on:
push:
branches:
- 'master'
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: sed -i -e "s~@database-uri~$DATABASE_URI~g" app.yaml
env:
DATABASE_URI: ${{secrets.DATABASE_URI}}
- run: sed -i -e "s~@mongodb-uri~$MONGODB_URI~g" app.yaml
env:
MONGODB_URI: ${{secrets.MONGODB_URI}}
- uses: actions-hub/gcloud@master
env:
PROJECT_ID: ${{secrets.GCLOUD_PROJECT_ID}}
APPLICATION_CREDENTIALS: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}}
with:
args: app -q deploy app.yaml --promote

5
app.yaml Normal file
View File

@@ -0,0 +1,5 @@
runtime: nodejs12
env_variables:
DATABASE_URI: @database-uri
MONGODB_URI: @mongodb-uri

View File

@@ -4,7 +4,7 @@
"main": "scraper/index.js",
"engines": {
"npm": "6.x",
"node": "10.x"
"node": "12.x"
},
"scripts": {
"start": "node scraper/index.js"