pompy.dev/.github/workflows/firebase-hosting-merge.yml

53 lines
1.8 KiB
YAML

name: Deploy to Firebase Hosting on merge
on:
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- uses: actions/cache@main
with:
path: "source/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('source/yarn.lock') }}
- name: Install Dependencies and Build
run: cd source && yarn install && yarn build
- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: build
path: source/build
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: build
path: source/build
- name: Set target
uses: w9jds/firebase-action@master
with:
args: use developomp-site
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
- name: Apply target
uses: w9jds/firebase-action@master
with:
args: target:apply hosting stable developomp-site
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only hosting:stable
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}