-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (63 loc) · 2.33 KB
/
build_release.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
name: CI (Build 🏗️ & Release 📦)
on:
push:
tags:
- "*"
defaults:
run:
working-directory: "./Track 4_ReactJS_Web Development/Project/Frontend/hrc-dashboard"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Install dependencies
run: npm install --force
# - name: Test
# run: npm test
# env:
# CI: true
- name: Generate build
run: npm run build
# Share artifact inside workflow
- name: Share artifact inside workflow
uses: actions/upload-artifact@v1
with:
name: react-github-actions-build
path: "./Track 4_ReactJS_Web Development/Project/Frontend/hrc-dashboard/build"
release:
runs-on: ubuntu-latest
# We specify that deploys needs to
# finish before we create a release
needs: build
steps:
# Download previously shared build
- name: Get artifact
uses: actions/download-artifact@v1
with:
name: react-github-actions-build
# Zip the build using external action
- name: Zip build
uses: thedoctor0/zip-release@master
with:
filename: react-github-actions-release-build.zip
path: react-github-actions-build
# Upload as an artifact of the current workflow
- name: Upload build zip artifact
uses: actions/upload-artifact@v1
with:
name: react-github-actions-release-build.zip
path: react-github-actions-release-build.zip
# Make official GitHub release which will trigger
# sending the mail with link for access
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: react-github-actions-release-build.zip
body: "Automated build with GitHub actions 📦🏗️"
token: ${{ secrets.RELEASE_TOKEN }}