Update ci cd tools #7 #32
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: Casanet lightweight dashboard CI CD | |
on: [push, workflow_dispatch] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Bundle www # The assets build for the public CDN | |
env: | |
API_URL_PROD: '${{ secrets.API_URL }}' | |
API_URL_DEV: '${{ secrets.API_URL_DEV }}' | |
run: | | |
export ON_BRANCH=${GITHUB_REF##*/} | |
if [[ $ON_BRANCH == 'main' ]]; then export API_URL=$API_URL_PROD ; else export API_URL=$API_URL_DEV; fi | |
node scripts/set-environment.js | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: www | |
path: src | |
- name: Bundle internal # The assets build for the local server, the api server is just '' | |
env: | |
API_URL: '' | |
run: | | |
node scripts/set-environment.js | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: internal | |
path: src |