Skip to content

Commit d61254b

Browse files
Merge pull request #270 from Pylons/github-actions
Add Github action to build website
2 parents c1549ca + 4ddf706 commit d61254b

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/build.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Site Builder
2+
# This workflow is triggered on pushes to the repository.
3+
on:
4+
push:
5+
pull_request:
6+
release:
7+
types:
8+
- created
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
name: "Build the trypyramid.com website"
14+
steps:
15+
- uses: actions/checkout@master
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: '13.x'
20+
- run: npm install
21+
- run: npm run build
22+
- name: Upload artifacts
23+
uses: actions/upload-artifact@master
24+
with:
25+
name: built-dist
26+
path: dist
27+
28+
release:
29+
runs-on: ubuntu-latest
30+
if: github.event_name == 'release'
31+
needs: build
32+
steps:
33+
- name: Download the dist artifact
34+
uses: actions/download-artifact@v1
35+
with:
36+
name: built-dist
37+
- name: Zip artifacts
38+
run: zip -r website.zip ./dist/
39+
- name: Upload website.zip to Github release
40+
uses: actions/upload-release-asset@v1
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
with:
44+
upload_url: ${{ github.event.release.upload_url }}
45+
asset_path: website.zip
46+
asset_name: website.zip
47+
asset_content_type: application/zip
48+
49+
audit:
50+
runs-on: ubuntu-latest
51+
name: "Audit the NPM packages"
52+
steps:
53+
- uses: actions/checkout@master
54+
- name: Setup Node.js
55+
uses: actions/setup-node@v1
56+
with:
57+
node-version: '13.x'
58+
- run: npm install
59+
- run: npm audit
60+
continue-on-error: true

0 commit comments

Comments
 (0)