Skip to content

Improve workflows to support beta docker images #1

Improve workflows to support beta docker images

Improve workflows to support beta docker images #1

name: Deploy to Firebase Hosting
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build_and_deploy:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Run GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: false
- name: Update package version
run: |
sed -i.bak "s|\"version\": \"[0-9\.]*\"|\"version\": \"${{ steps.gitversion.outputs.semVer }}\"|" package.json
- name: Cache UI Dependencies
id: cache_ui
uses: actions/cache@v4
with:
path: ui/node_modules
key: ${{ runner.os }}-ui-${{ hashFiles('ui/package-lock.json') }}
restore-keys: |
${{ runner.os }}-ui-
- name: Install UI dependencies
if: steps.cache_ui.outputs.cache-hit != 'true'
run: npm --prefix ui install
- name: Build AutoML UI
run: npm --prefix ui run build
- name: Deploy to Firebase Hosting
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_MILO_ML }}
projectId: milo-ml
channelId: ${{ github.event_name == 'push' && 'live' || '' }}