Skip to content

Commit 8aae463

Browse files
authored
feat: Add flags input and tests (#57)
* feat: Add flags input and tests * test * update tests and name
1 parent 488c9eb commit 8aae463

File tree

12 files changed

+4142
-728
lines changed

12 files changed

+4142
-728
lines changed

.eslintrc.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ module.exports = {
2323
'plugin:@typescript-eslint/eslint-recommended',
2424
'plugin:@typescript-eslint/recommended',
2525
'plugin:prettier/recommended',
26-
'prettier/@typescript-eslint',
2726
],
27+
rules: {
28+
'@typescript-eslint/camelcase': 'off',
29+
'@typescript-eslint/no-non-null-assertion': 'off',
30+
}
2831
};

.github/workflows/deploy-appengine-inputs-it.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,63 @@ name: deploy-appengine Inputs Tests
33
on: [push, pull_request]
44

55
jobs:
6+
flags:
7+
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name }}
8+
name: with flags
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: google-github-actions/setup-gcloud@master
13+
with:
14+
project_id: ${{ secrets.APPENGINE_DEPLOY_PROJECT_ID }}
15+
service_account_key: ${{ secrets.APPENGINE_DEPLOY_SA_KEY_JSON }}
16+
- name: create app
17+
run: |-
18+
mkdir app
19+
cat <<EOF > ${{ github.workspace }}/app/app.yaml
20+
service: "${{ github.job }}-${{ github.run_number }}"
21+
runtime: "nodejs10"
22+
EOF
23+
24+
cat <<EOF > ${{ github.workspace }}/app/server.js
25+
const http = require('http');
26+
const server = http.createServer(function (req, res) {
27+
res.writeHead(200)
28+
res.end('Hello world!');
29+
});
30+
server.listen(process.env.PORT || 8080);
31+
EOF
32+
- name: Build dependency
33+
working-directory: setupGcloudSDK
34+
run: |-
35+
npm install
36+
npm run build
37+
- id: build
38+
name: Build dist
39+
run: |-
40+
npm install
41+
npm run build
42+
- id: deploy
43+
name: Deploy to App Engine
44+
uses: ./
45+
with:
46+
project_id: ${{ secrets.APPENGINE_DEPLOY_PROJECT_ID }}
47+
working_directory: app/
48+
flags: --log-http --verbosity=debug
49+
- name: Test Output
50+
run: |-
51+
curl '${{ steps.deploy.outputs.url }}' \
52+
--silent \
53+
--fail \
54+
--location \
55+
--retry 5 \
56+
--retry-connrefused \
57+
--retry-delay 5 \
58+
--retry-max-time 300
59+
- name: Clean Up
60+
if: ${{ always() }}
61+
run: gcloud app services delete "${{ github.job }}-${{ github.run_number }}" --quiet
62+
663
bad-input:
764
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name }}
865
name: with bad inputs

action.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
name: Deploy to Google App Engine
15+
name: Deploy to App Engine
1616
author: Google LLC
1717
description: |-
1818
Use this action to deploy an application to Google App Engine.
@@ -39,7 +39,7 @@ inputs:
3939
image_url:
4040
description: |-
4141
Deploy with a specific container image. The image URL must be from one of
42-
the valid GCR hostnames.
42+
the valid GCR host names.
4343
required: false
4444

4545
version:
@@ -61,6 +61,13 @@ inputs:
6161
value can be raw or base64-encoded.
6262
required: false
6363

64+
flags:
65+
description: |-
66+
Space separated list of other App Engine flags, examples can be found:
67+
https://cloud.google.com/sdk/gcloud/reference/app/deploy#FLAGS. Ex
68+
[email protected] --no-cache
69+
required: false
70+
6471
outputs:
6572
url:
6673
description: URL of your App Engine Application

0 commit comments

Comments
 (0)