Skip to content

Commit 157ff20

Browse files
committed
chore(ci): add github actions
1 parent 08e3efe commit 157ff20

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

.github/workflows/build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: '16'
20+
21+
- name: Install dependencies
22+
run: npm install
23+
24+
- name: Build project
25+
run: npm run build
26+
27+
- name: Upload build artifacts
28+
uses: actions/upload-artifact@v2
29+
with:
30+
name: build-artifacts
31+
path: dist/

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Download build artifacts
17+
uses: actions/download-artifact@v2
18+
with:
19+
name: build-artifacts
20+
21+
- name: Create Release
22+
id: create_release
23+
uses: actions/create-release@v1
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
with:
27+
tag_name: ${{ github.ref }}
28+
release_name: Release ${{ github.ref }}
29+
draft: false
30+
prerelease: false
31+
32+
- name: Upload Release Asset
33+
uses: actions/upload-release-asset@v1
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
with:
37+
upload_url: ${{ steps.create_release.outputs.upload_url }}
38+
asset_path: ./dist/dispenser-schedule-card.min.js
39+
asset_name: dispenser-schedule-card.min.js
40+
asset_content_type: application/javascript

0 commit comments

Comments
 (0)