Production Build #164
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: 'Production Build' | |
on: | |
workflow_run: | |
workflows: ['Tests'] | |
branches: ['main'] | |
types: | |
- completed | |
jobs: | |
deploy: | |
name: 'Deploy' | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: main | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Use Java 11 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: zulu | |
java-version: 11 | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- run: npm ci | |
- run: npm run build:libs | |
- name: Build EUI | |
run: | | |
npm run build ccf-eui -- --output-hashing=none --base-href=/ccf-ui/ | |
npm run build:ccf-eui:wc | |
- name: Build RUI | |
run: | | |
npm run build ccf-rui -- --project ccf-rui --output-hashing=none --base-href=/ccf-ui/rui/ | |
npm run build:ccf-rui:wc | |
cp -r dist/ccf-rui dist/ccf-ui/rui | |
- name: Build Organ Info | |
run: | | |
npm run build ccf-organ-info -- --project ccf-organ-info --output-hashing=none --base-href=/ccf-ui/organ-info/ --configuration=staging | |
npm run build:ccf-organ-info:wc | |
cp -r dist/ccf-organ-info dist/ccf-ui/organ-info | |
- name: Build Body UI WC | |
run: | | |
npm run build ccf-body-ui-wc -- --project ccf-body-ui-wc --output-hashing=none --base-href=/body-ui/ #--configuration=staging | |
npm run build:ccf-body-ui-wc:wc | |
mkdir -p dist/ccf-ui | |
cp -r dist/ccf-body-ui-wc dist/ccf-ui/body-ui | |
- run: | | |
npm run compodoc | |
mkdir -p dist/ccf-ui | |
cp -r docs dist/ccf-ui | |
- name: Setup GitHub Pages files | |
run: | | |
cp dist/ccf-ui/index.html dist/ccf-ui/404.html | |
touch dist/ccf-ui/.nojekyll | |
- uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: dist/ccf-ui | |
commit_message: "Production deploy -- ${{ github.event.head_commit.message }}" |