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 Sep 8, 2023
1 parent 4017d44 commit 7ba5ea8
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/backoffice_deploy_production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy Production

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

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

jobs:
test:
permissions:
contents: read
actions: read
uses: ./.github/workflows/backoffice_test_workflow.yaml

build_and_deploy:
needs: test
permissions:
contents: read
actions: read
uses: ./.github/workflows/backoffice_deploy_workflow.yaml
with:
environment: 'production'
27 changes: 27 additions & 0 deletions .github/workflows/backoffice_deploy_staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Deploy Staging

on:
push:
branches:
- master
- vivien/backoffice-ci

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

jobs:
test:
permissions:
contents: read
actions: read
uses: ./.github/workflows/backoffice_test_workflow.yaml

build_and_deploy:
needs: test
permissions:
contents: read
actions: read
uses: ./.github/workflows/backoffice_deploy_workflow.yaml
with:
environment: 'staging'
31 changes: 31 additions & 0 deletions .github/workflows/backoffice_deploy_workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy BackOffice

on:
workflow_call:
inputs:
environment:
type: string
description: 'Github environment to use'
required: true

jobs:
build_backoffice:
name: Build BackOffice
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
- name: 'Build ${{ inputs.environment }}'
run: 'yarn build-${{ inputs.environment }}'
working-directory: marble-backoffice
- name: Deploy to Firebase
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.GCP_SA_KEY }}'
projectId: '${{ inputs.environment }}'
channelId: live
20 changes: 20 additions & 0 deletions .github/workflows/backoffice_test_workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test Backoffice

on:
workflow_call:

jobs:
test_backoffice:
name: Test BackOffice
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 7ba5ea8

Please sign in to comment.