Skip to content

Commit

Permalink
fix(ci): fix deploy trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
ThornWalli committed May 30, 2022
1 parent bd8b362 commit 3971268
Showing 1 changed file with 69 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Deploy (Firebase)
name: Deploy
on:
release:
types: [published]
push:
tags:
- "v*"

jobs:
install:
Expand Down Expand Up @@ -35,9 +36,10 @@ jobs:
- name: Test
run: npm run test

build:
build-firebase:
name: Build (Firebase)
needs: install
if: "!github.event.release.prerelease"
runs-on: ${{ matrix.os }}

strategy:
Expand Down Expand Up @@ -77,9 +79,9 @@ jobs:
name: artifact
path: dist

deploy:
deploy-firebase:
name: Deploy (Firebase)
needs: build
needs: build-firebase
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -98,3 +100,64 @@ jobs:
env:
PROJECT_PATH: public
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}

build-ghpages:
name: Build (Github-Pages)
needs: install
if: "github.event.release.prerelease"
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [16]

steps:
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}

- name: Checkout Repo
uses: actions/checkout@v2

- name: cache node_modules
uses: actions/cache@v2
id: cache
with:
path: node_modules
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}

- name: Build
run: |
npm run generate
env:
WEBSITE_HOST: https://thornwalli.github.io/web-workbench/
DIST_PATH: dist
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
FIREBASE_URL: ${{ secrets.FIREBASE_URL }}

- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: artifact
path: dist

deploy-ghpages:
name: Deploy (Github-Pages)
needs: build-ghpages
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [16]
steps:
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: artifact
path: public
- name: Deploy to Github-Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: public

0 comments on commit 3971268

Please sign in to comment.