Skip to content

Commit 2161670

Browse files
committed
chore(actions): add github workflows
1 parent f8da546 commit 2161670

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

.github/workflows/build.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
node-version: [12.x]
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
name: Checkout repository (trigger)
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
- run: npm install
22+
- run: gulp regenerate
23+
- run: zip -r build.zip build
24+
- name: Artificat Production
25+
uses: actions/upload-artifact@v1
26+
with:
27+
name: build
28+
path: build
29+
- name: Delete latest release
30+
uses: omarabid-forks/action-delete-latest-release@v2
31+
with:
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Create Release
35+
id: create_release
36+
uses: actions/create-release@latest
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
39+
with:
40+
tag_name: live
41+
release_name: Live Release
42+
body: Latest build
43+
draft: false
44+
prerelease: false
45+
46+
- name: Upload Artifact
47+
id: upload-release-asset
48+
uses: actions/upload-release-asset@v1
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
with:
52+
upload_url: ${{ steps.create_release.outputs.upload_url }}
53+
asset_path: build.zip
54+
asset_name: build.zip
55+
asset_content_type: application/zip
56+
57+
- name: Remove old artifacts
58+
uses: omarabid-forks/purge-artifacts@v1
59+
with:
60+
token: ${{ secrets.GITHUB_TOKEN }}
61+
expire-in: 0

.github/workflows/tests.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Jest
2+
on: push
3+
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- name: Install modules
10+
run: npm install
11+
- name: Run tests
12+
run: npm run test

0 commit comments

Comments
 (0)