Skip to content

Commit

Permalink
ci: backoffice build and deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
Vivien-marble committed Aug 4, 2023
1 parent 3c80c59 commit 22f1e4d
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/backoffice_deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Deploy BackOffice Staging

# on:
# push:
# branches:
# - master
# tags:
# - "v[0-9]+.[0-9]+.[0-9]+"
on: [pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
debug:
runs-on: ubuntu-latest
steps:
- name: display github.ref
run: echo ${{ github.ref }}
build_backoffice_staging:
# if: github.ref == 'refs/heads/master'
name: Build BackOffice Staging
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install dependencies using yarn --frozen-lockfile
uses: bahmutov/npm-install@v1
with:
working-directory: marble-backoffice
env:
NODE_ENV: production
- name: Build staging
run: yarn build-staging
working-directory: marble-backoffice
- name: Upload staging build files
uses: actions/upload-artifact@v3
with:
name: staging-files
path: ./marble-backoffice/dist

## firebase deploy --project staging --only hosting
deploy_backoffice_staging:
# if: github.ref == 'refs/heads/master'
name: Deploy BackOffice Staging
needs: build_backoffice_staging
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: staging-files
path: ./marble-backoffice/dist
- name: Deploy to Firebase Staging
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
projectId: staging
channelId: live
19 changes: 19 additions & 0 deletions .github/workflows/backoffice_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Test Backoffice

on: [pull_request]

jobs:
build_backoffice_staging:
name: Build BackOffice Staging
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: bahmutov/npm-install@v1
with:
working-directory: marble-backoffice
- name: typecheck
run: yarn tsc --noEmit
working-directory: marble-backoffice
- name: Test
run: yarn test
working-directory: marble-backoffice

0 comments on commit 22f1e4d

Please sign in to comment.