-
Notifications
You must be signed in to change notification settings - Fork 14
63 lines (58 loc) · 1.72 KB
/
node_sample.yaml
File metadata and controls
63 lines (58 loc) · 1.72 KB
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
name: Node.js GitHub Actions Demo
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: Install dependencies
run: npm install
- run: npm run build --if-present
# - run: npm test
- name: Create zip bundle
run: |
echo 'zippig artifact'
zip -r ./${{ github.sha }}.zip .
pwd
ls -la
- name: Archive artifact
uses: actions/upload-artifact@v2
with:
name: zipped-bundle
path: ${{ github.sha }}.zip
publish:
runs-on: ubuntu-latest
needs: build
steps:
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.github_token }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.run_number }}
release_name: Release ${{ github.run_number }}
body: New release for ${{ github.sha }}
draft: false
prerelease: false
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: zipped-bundle
- 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: ./${{ github.sha }}.zip
asset_name: source_code_with_npm_modules.zip
asset_content_type: application/zip