Skip to content

Commit

Permalink
Merge pull request #1 from ActiveChristianity/main
Browse files Browse the repository at this point in the history
Add no-cache option
  • Loading branch information
vijayp23 authored Dec 20, 2020
2 parents 41138ff + 8cd92e9 commit 271e899
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This action will allow you to deploy [Google App Engine](https://cloud.google.co
service-version: 3 #default value : ""
delete-previous-versions: true #default value : false
service-name: ${{ secrets.SERVICE_NAME }} #default value : default
no-cache: false #default value : false
debug: false #default value : false
```
## Inputs
Expand All @@ -35,6 +36,7 @@ This action will allow you to deploy [Google App Engine](https://cloud.google.co
* `service-version`: version of the app that will be created or replaced by this deployment
* `delete-previous-versions`: set it to `true` to delete previous versions which are not receiving any traffic. If this is set to `true` then `service-name` is required
* `service-name`: name of the service of which previous versions needs to be deleted. Set it to `default` if service name is not mentioned in config file
* `no-cache`: deploy project without using cache. Takes longer, but useful in some cases. Set to `true` to not use cache
* `debug`: test action and check version details

## Note
Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ inputs:
description: 'Name of the service which previous versions needs to be deleted'
required: false
default: "default"
no-cache:
description: 'Disables using of cache when building project'
required: false
dafault: false
debug:
description: 'Debug action'
required: false
Expand All @@ -31,4 +35,4 @@ runs:
main: 'index.js'
branding:
icon: 'pocket'
color: 'blue'
color: 'blue'
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ async function run() {
const serviceVersion = core.getInput('service-version');
const serviceName = core.getInput('service-name');
const deletePrevVersions = core.getInput('delete-previous-versions');
var isDebug = core.getInput('debug');
var isDebug = core.getInput('debug');
const noCache = core.getInput('no-cache');

var versionFlag = "";

Expand All @@ -34,9 +35,9 @@ async function run() {

core.startGroup('deploy google app engine');
if (isDebug) {
console.log(`gcloud app deploy --appyaml=${configFile} --project=${projectId} ${serviceVersion} --promote --stop-previous-version`);
console.log(`gcloud app deploy ${noCache ? '--no-cache'} --appyaml=${configFile} --project=${projectId} ${serviceVersion} --promote --stop-previous-version`);
} else {
execSync(`gcloud app deploy --appyaml=${configFile} --project=${projectId} ${versionFlag} --promote --stop-previous-version`, { stdio: 'inherit' });
execSync(`gcloud app deploy ${noCache ? '--no-cache'} --appyaml=${configFile} --project=${projectId} ${versionFlag} --promote --stop-previous-version`, { stdio: 'inherit' });
}
core.endGroup();
}
Expand Down Expand Up @@ -98,4 +99,4 @@ async function run() {
}
}

run();
run();

0 comments on commit 271e899

Please sign in to comment.