diff --git a/.github/workflows/deploy-pipeline.yml b/.github/workflows/deploy-pipeline.yml new file mode 100644 index 0000000..755c8c8 --- /dev/null +++ b/.github/workflows/deploy-pipeline.yml @@ -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 \ No newline at end of file diff --git a/app.yaml b/app.yaml new file mode 100644 index 0000000..cce46e4 --- /dev/null +++ b/app.yaml @@ -0,0 +1,5 @@ +runtime: nodejs12 + +env_variables: + DATABASE_URI: @database-uri + MONGODB_URI: @mongodb-uri \ No newline at end of file diff --git a/package.json b/package.json index e967aec..d93e26a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "main": "scraper/index.js", "engines": { "npm": "6.x", - "node": "10.x" + "node": "12.x" }, "scripts": { "start": "node scraper/index.js"