-
Notifications
You must be signed in to change notification settings - Fork 1
224 lines (164 loc) · 6.63 KB
/
node.js.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [ master ]
jobs:
Deploy :
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Push to Heroku
if: job.status == 'success'
run: git push -f https://heroku:${{ secrets.HEROKU_TOKEN }}@git.heroku.com/${{ secrets.HEROKU_APP }}.git origin/master:master
# steps:
# - uses: actions/checkout@v2
# - name: Push to Heroku
# uses: actions/setup-node@v2
# with:
# node-version: 16
# cache: 'npm'
# heroku_api_key: ${{ secrets.HEROKU_TOKEN }}
# heroku_app_name: ${{ secrets.HEROKU_APP }}#Must be unique in Heroku
# heroku_email: ${{ secrets.HEROKU_EMAIL }}
# procfile: "web: npm start"
# - name: Set up secret file
# env:
# HEROKU_TOKEN: ${{ secrets.HEROKU_TOKEN }}
# HEROKU_APP: ${{ secrets.HEROKU_APP }}
# HEROKU_EMAIL: ${{ secrets.HEROKU_EMAIL }}
# run: |
# echo $HEROKU_TOKEN >> secrets.txt
# echo $HEROKU_APP >> secrets.txt
# echo $HEROKU_EMAIL >> secrets.txt
# - name: Run tmate
# uses: mxschmitt/action-tmate@v2
# - name: checking out code
# uses: actions/checkout@v2
# - name: extract git commit data
# uses: rlespinasse/[email protected]
# - name: Update author information
# run: echo ${{ env.GIT_COMMIT_AUTHOR_NAME }} > AUTHOR
# - name: Raise PR
# uses: peter-evans/create-pull-request@v3
# with:
# branch: "auto-pr-branch-1"
# base: master
# title: "Deployed Application successfully"
# committer: ${{ env.GIT_COMMIT_AUTHOR_NAME }} <${{ env.GIT_COMMIT_AUTHOR_EMAIL }}">
# author: ${{ env.GIT_COMMIT_AUTHOR_NAME }} <${{ env.GIT_COMMIT_AUTHOR_EMAIL }}">
# body:
# Review app will be availabe at https://${{ secrets.HEROKU_APP }}.herokuapp.com
# token: ${{ secrets.GITHUB_TOKEN }}
# # delete-branch: true
# name: Node.js CI
# on:
# push:
# branches: [ main ]
# jobs:
# updateAuthor:
# runs-on: ubuntu-latest
# steps:
# - name: checking out code
# uses: actions/checkout@v2
# - name: extract git commit data
# uses: rlespinasse/[email protected]
# - name: Update author information
# run: echo ${{ env.GIT_COMMIT_AUTHOR_NAME }} > AUTHOR
# - name: Raise PR
# uses: peter-evans/create-pull-request@v3
# with:
# branch: "auto-pr-branch"
# base: main
# title: "demo for auto pr"
# committer: ${{ env.GIT_COMMIT_AUTHOR_NAME }} <${{ env.GIT_COMMIT_AUTHOR_EMAIL }}">
# author: ${{ env.GIT_COMMIT_AUTHOR_NAME }} <${{ env.GIT_COMMIT_AUTHOR_EMAIL }}">
# body:
# This is to show automatic PR creation
# token: ${{ secrets.GITHUB_TOKEN }}
# delete-branch: true
# jobs:
# build:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [12.x, 14.x, 16.x]
# # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
# steps:
# - uses: actions/checkout@v2
# - name: Push to Heroku
# uses: actions/setup-node@v2
# with:
# node-version: 16
# cache: 'npm'
# heroku_api_key: ${{ secrets.HEROKU_TOKEN }}
# heroku_app_name: ${{ secrets.HEROKU_APP }}#Must be unique in Heroku
# heroku_email: ${{ secrets.HEROKU_EMAIL }}
# procfile: "web: npm start"
# - name: Create GitHub Pull Reaquest Action
# # You may pin to the exact commit or the version.
# # uses: poad/github-pull-requester@4305b5c39bb2d6c0f15c5c5707446cb17a67ad46
# uses: poad/[email protected]
# with:
# head_branch: test-branch
# github_token: ${{ secrets.PAT }}
# # owner
# owner: mohantechnology
# # target repository
# repository: mohantechnology/test-automated-api
# # target(base) branch name to merge
# # base_branch: # optional, default is main
# # title for pull request
# # title: # optional, default is Created by GitHub Action
# # body text for pull request
# # body: # optional, default is
# #
# #### create pull request
# - name: Create Pull Request
# uses: peter-evans/create-pull-request@v3
# with:
# token: ${{ secrets.PAT }}
# commit-message: Add report file
# title: '[Example] Add report file'
# body: >
# This PR is auto-generated by
# [create-pull-request](https://github.com/peter-evans/create-pull-request).
# - uses: actions/checkout@v3
# # Make changes to pull request here
# - uses: actions/checkout@v3
# - name: Create Pull Request
# # uses: mohantechnology/www
# # - name: Create Pull Request
# uses: mohantechnology/www@v4
# with:
# commit-message: updated app
# title: Update Changelog
# # body: please preview the app at https://${{ secrets.HEROKU_APP }}.herokuapp.com
# body: sample body
# branch: update-changelog
# base: main
# # buildpack: "https://github.com/HashNuke/heroku-buildpack-elixir.git"
# # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
# name: Node.js CI
# on:
# push:
# branches: [ master ]
# jobs:
# build:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [12.x, 14.x, 16.x]
# # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
# steps:
# - uses: actions/checkout@v2
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v2
# with:
# node-version: ${{ matrix.node-version }}
# cache: 'npm'
# - run: npm ci
# - run: npm run build --if-present
# - run: npm test