Merge branch 'dev' into download-origin #109
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |