-
Notifications
You must be signed in to change notification settings - Fork 0
229 lines (215 loc) · 6.88 KB
/
main.yaml
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
225
226
227
228
229
name: Dev Pipeline
on:
push:
branches:
- main
- fix/article
tags:
- v*
jobs:
# static-scan:
# runs-on: ubuntu-latest
# env:
# JSON_OUTPUT: snyk-static-scan.json
# steps:
# - uses: actions/checkout@master
# - uses: snyk/actions/setup@master
# - uses: actions/setup-go@v1
# - name: Run Snyk to check for vulnerabilities
# continue-on-error: true
# run: |
# snyk code test
# snyk-to-html -i $JSON_OUTPUT -o snyk.html
# env:
# SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
# - name: Archive snyk results
# uses: actions/upload-artifact@v3
# with:
# name: snyk-report
# path: output/scan/snyk.html
# retention-days: 5
# dependency-scan:
# runs-on: ubuntu-latest
# env:
# JSON_OUTPUT: snyk-dependency-scan.json
# steps:
# - uses: actions/checkout@master
# - uses: snyk/actions/setup@master
# - uses: actions/setup-go@v1
# - name: Run Snyk to check for vulnerabilities
# continue-on-error: true
# run: |
# snyk test
# snyk-to-html -i $JSON_OUTPUT -o snyk.html
# env:
# SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
# - name: Archive snyk results
# uses: actions/upload-artifact@v3
# with:
# name: snyk-report
# path: output/scan/snyk.html
# retention-days: 5
# lint:
# needs: [static-scan, dependency-scan]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - run: npm i --legacy-peer-deps
# - name: lint
# continue-on-error: true
# run: npm run lint
build:
# needs: [static-scan, dependency-scan, lint]
runs-on: ubuntu-latest
outputs:
build_path: ${{ steps.archive_build.outputs.build_path }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install Dependencies
run: npm install --legacy-peer-deps
- name: Build project
run: |
export SKIP_PREFLIGHT_CHECK=true
npm run build
- name: Archive build output
id: archive_build
run: |
tar -czf build.tar.gz build/
echo "::set-output name=build_path::build.tar.gz"
- name: Create conventional changelog action
id: changelog
uses: TriPSs/conventional-changelog-action@latest
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
tag-prefix: "dev.v"
git-push: false
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: v${{ github.ref_name }} - ${{ steps.changelog.outputs.tag }}
with:
tag_name: $tag
release_name: Release $tag
body: ${{steps.changelog.outputs.clean_changelog}}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build.tar.gz
asset_name: build.tar.gz
asset_content_type: application/gzip
# - name: Deploy to Heroku
# uses: akhileshns/[email protected]
# with:
# heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
# heroku_app_name: hoseacodes-dev
# heroku_email: "[email protected]"
# release:
# needs: [build]
# name: Release pushed tag
# runs-on: ubuntu-22.04
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# fetch-depth: 0 # required for github-action-get-previous-tag
# - name: Get previous tag
# id: previoustag
# uses: 'WyriHaximus/github-action-get-previous-tag@v1'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Get next minor version
# id: semver
# uses: 'WyriHaximus/github-action-next-semvers@v1'
# with:
# version: ${{ steps.previoustag.outputs.tag }}
# - name: Create Tag
# uses: rickstaa/[email protected]
# with:
# tag: v${{ steps.semver.outputs.patch }}-${{ github.ref_name }}
# - name: Create release
# id: create_release_id
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# tag: Release v${{ steps.semver.outputs.patch }}-${{ github.ref_name }}
# run: |
# gh release create "$tag" \
# --repo="$GITHUB_REPOSITORY" \
# --title="${tag#v}" \
# --generate-notes \
# --draft \
# ./dist/*.tgz
# build:
# runs-on: ubuntu-latest
# outputs:
# build_path: ${{ steps.archive_build.outputs.build_path }}
# steps:
# - name: Checkout repository
# uses: actions/checkout@v2
# - name: Set up Node.js
# uses: actions/setup-node@v2
# with:
# node-version: '20'
# - name: Install dependencies
# run: npm install --legacy-peer-deps
# - name: Build project
# run: |
# export SKIP_PREFLIGHT_CHECK=true
# npm run build
# - name: Archive build output
# id: archive_build
# run: |
# tar -czf build.tar.gz build/
# echo "::set-output name=build_path::build.tar.gz"
# release:
# runs-on: ubuntu-latest
# needs: build
# outputs:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# - name: Create GitHub Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# tag: v${{ github.ref_name }}
# with:
# tag_name: "$tag"
# release_name: Release "$tag"
# body: |
# Release notes for "$tag"
# draft: false
# prerelease: false
# deploy:
# runs-on: ubuntu-latest
# needs: [build, release]
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# - name: Download build artifact
# run: |
# echo "Downloading build artifact..."
# curl -L -o build.tar.gz ${{ needs.build.outputs.build_path }}
# - name: Upload Release Asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ needs.release.outputs.upload_url }}
# asset_path: build.tar.gz
# asset_name: build.tar.gz
# asset_content_type: application/gzip
# #