Skip to content

feat: workflow added for generating frontend build #1

feat: workflow added for generating frontend build

feat: workflow added for generating frontend build #1

name: Continuous Integration for Frontend
on:
push:

Check failure on line 4 in .github/workflows/generate-frontend-build.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/generate-frontend-build.yml

Invalid workflow file

You have an error in your yaml syntax on line 4
branches:
- main
paths:
- 'frontend/**'
pull_request:
types:
- [opened, reopened]
branches:
- main
paths:
- 'frontend/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install dependencies
run: |
cd frontend
yarn install
- name: Building app
run: yarn build
- name: Extract branch name
id: extract_branch
run: |
if [[ ${{ github.ref }} == "refs/heads/development" ]]; then
echo "::set-output name=branch::dev"
elif [[ ${{ github.ref }} == "refs/heads/staging" ]]; then
echo "::set-output name=branch::staging"
elif [[ ${{ github.ref }} == "refs/heads/main" ]]; then
echo "::set-output name=branch::prod"
else
echo "Error: Invalid branch name"
exit 1
fi
- name: push frontend build to branch
uses: Healthlane-Technologies/Zango/.github/workflows/sync-docs-to-docs-hub-main.yml@v0.2.0
with:
source-directory: "backend/src/zango/assets/app_panel/js"
target-directory: "backend/src/zango/assets/app_panel/js"
destination-github-username: ${{github.actor}}
destination-repository-name: "Zango"
commit-message: "Push build to ${{ steps.extract_branch.outputs.branch }}"
target-branch: ${{ steps.extract_branch.outputs.branch }}
secrets: inherit