-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (65 loc) · 2.26 KB
/
test_and_build.yml
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
65
66
67
68
69
70
71
72
73
74
75
76
name: test_and_build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '19.2.0'
cache: 'npm'
- name: 🔧 - Install
run: |
cp config.yml.example config.yml
npm i -g [email protected]
npm ci
# Conditional execution of building steps for the different branches
# dev -> dev
# master -> staging, master
- name: 🏗 - Build dev
if: github.ref == 'refs/heads/dev'
run: |
cp config/dev_config.yml config.yml
npm run deploy -- -- --output-path=dist/dev/
- name: Upload Dev Build Artifact
if: github.ref == 'refs/heads/dev'
uses: actions/upload-artifact@v4
with:
name: dev-build-artifact
path: dist/dev/**
- name: 🏗 - Build staging
if: github.ref == 'refs/heads/master'
run: |
cp config/staging_config.yml config.yml
npm run deploy -- -- --output-path=dist/staging/
- name: Upload Staging Build Artifact
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: staging-build-artifact
path: dist/staging/**
- name: 🏗 - Build master
if: github.ref == 'refs/heads/master'
run: |
cp config/master_config.yml config.yml
npm run deploy -- -- --output-path=dist/master/
- name: Upload Master Build Artifact
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: master-build-artifact
path: dist/master/**
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
continue-on-error: true
if: |
github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
env:
SLACK_COLOR: "${{ job.status == 'success' && 'good' || 'danger' }}"
SLACK_USERNAME: 'Github Actions'
SLACK_ICON_EMOJI: ':octocat:'
SLACK_TITLE: 'CI results in GitHub Actions'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: '#interpro7'
MSG_MINIMAL: Actions URL