Skip to content

Commit

Permalink
Organize and improve workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
erikasv committed Feb 14, 2024
1 parent 7f6a026 commit d56bee3
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 66 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
name: CI for features
name: Check format

on:
push:
branches:
- feature/*
- release/*

jobs:
feature:
Check format:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
cache: yarn
- run: yarn install
node-version-file: 'package.json'
cache: pnpm
- run: pnpm install
- name: Run prettier
run: yarn run check-format
run: pnpm check-format
env:
CI: true
44 changes: 44 additions & 0 deletions .github/workflows/deploy_dev_stg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deploy dev or stg

on:
workflow_call:
inputs:
app_env:
required: true
type: string

env:
AZURE_WEBAPP_NAME: biotablero-frontend
REACT_APP_ENVIRONMENT: ${{ inputs.config-app_env }}
REACT_APP_BACKEND_BIAB_URL: ${{ vars.BACKEND_BIAB_URL }}
REACT_APP_BACKEND_URL: ${{ vars.BACKEND_URL }}
REACT_APP_BACKEND_KEY: ${{ secrets.BACKEND_KEY }}
REACT_APP_GA_TRACKING_ID: ${{ vars.GA_TRACKING_ID }}

jobs:
build-and-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
environment: develop

steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: 'package.json'
cache: pnpm

- name: install & build
run: |
pnpm -r install
pnpm -r build-pkg
pnpm install
pnpm build
- name: Deploy to Azure WebApp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
42 changes: 5 additions & 37 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,13 @@
name: CD for develop
name: Deploy develop

on:
push:
branches:
- develop
workflow_dispatch:

env:
AZURE_WEBAPP_NAME: biotablero-frontend
REACT_APP_ENVIRONMENT: develop
REACT_APP_BACKEND_BIAB_URL: ${{ vars.BACKEND_BIAB_URL }}
REACT_APP_BACKEND_URL: ${{ vars.BACKEND_URL }}
REACT_APP_BACKEND_KEY: ${{ secrets.BACKEND_KEY }}
REACT_APP_GA_TRACKING_ID: ${{ vars.GA_TRACKING_ID }}

jobs:
build-and-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
environment:
name: develop
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: yarn

- name: install & build
run: |
yarn workspaces foreach install
yarn workspaces foreach run build-pkg
yarn install
yarn run build
- name: Deploy to Azure WebApp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
call-deploy:
uses: .github/workflows/deploy_dev_stg.yml
with:
app_env: develop
23 changes: 0 additions & 23 deletions .github/workflows/release.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Deploy staging

on:
push:
branches:
- release/*
workflow_dispatch:

jobs:
call-deploy:
uses: .github/workflows/deploy_dev_stg.yml
with:
app_env: staging

0 comments on commit d56bee3

Please sign in to comment.