diff --git a/.github/workflows/appengine_deploy.yml b/.github/workflows/appengine_deploy.yml new file mode 100644 index 00000000000..f768874a31e --- /dev/null +++ b/.github/workflows/appengine_deploy.yml @@ -0,0 +1,54 @@ +# Workflow that prepares files and deploys to appengine + +name: Deploy to App Engine + +# Controls when the workflow will run +on: + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + prepare: + name: Prepare + runs-on: ubuntu-latest + + steps: + # Checks-out the repository under $GITHUB_WORKSPACE. + # When running manually this checks out the master branch. + - uses: actions/checkout@v2 + + - name: Prepare demo files + # Install all dependencies, then copy all the files needed for demos. + run: | + npm install + npm run prepareDemos + + - name: Upload + uses: actions/upload-artifact@v2 + with: + name: appengine_files + path: _deploy/ + + deploy: + name: Deploy + runs-on: ubuntu-latest + # The prepare step must succeed for this step to run. + needs: prepare + steps: + - name: Download prepared files + uses: actions/download-artifact@v2 + with: + name: appengine_files + path: _deploy/ + + - name: Deploy to App Engine + uses: google-github-actions/deploy-appengine@v0.2.0 + # For parameters see: + # https://github.com/google-github-actions/deploy-appengine#inputs + with: + working_directory: _deploy/ + deliverables: app.yaml + project_id: ${{ secrets.GCP_PROJECT }} + credentials: ${{ secrets.GCP_SA_KEY }} + promote: false + version: vtest diff --git a/gulpfile.js b/gulpfile.js index 49621147278..3f0dc46a436 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -39,6 +39,7 @@ module.exports = { package: packageTasks.package, checkLicenses: licenseTasks.checkLicenses, recompile: releaseTasks.recompile, + prepareDemos: appengineTasks.prepareDemos, publish: releaseTasks.publish, publishBeta: releaseTasks.publishBeta, sortRequires: cleanupTasks.sortRequires, diff --git a/package.json b/package.json index 3e9a293f2c1..33ac9283502 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "lint": "eslint .", "package": "gulp package", "prepare": "npm run package", + "prepareDemos": "gulp prepareDemos", "publish": "gulp publish", "publish:beta": "gulp publishBeta", "recompile": "gulp recompile", diff --git a/scripts/gulpfiles/appengine_tasks.js b/scripts/gulpfiles/appengine_tasks.js index 08fb3ea85ed..66573d3f52b 100644 --- a/scripts/gulpfiles/appengine_tasks.js +++ b/scripts/gulpfiles/appengine_tasks.js @@ -87,17 +87,19 @@ function deployAndClean(done) { done(); } +/** + * Prepares demos. + */ +const prepareDemos = gulp.series( + prepareDeployDir, copyStaticSrc, copyAppengineSrc, copyPlaygroundDeps); + + /** * Deploys demos. */ -const deployDemos = gulp.series( - prepareDeployDir, - copyStaticSrc, - copyAppengineSrc, - copyPlaygroundDeps, - deployAndClean -); +const deployDemos = gulp.series(prepareDemos, deployAndClean); module.exports = { deployDemos: deployDemos, + prepareDemos: prepareDemos }