Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: frontend continuous integration workflow addition #253

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/frontend-continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Continuous Integration for Frontend

on:
push:
# branches:
# - main
paths:
- 'frontend/**'
pull_request:
types:
- [opened, reopened]
# branches:
# - main
paths:
- 'frontend/**'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['14.x']
python-version: ['3.x']
# permissions:
# contents: write
steps:
- name: Checkout project code
uses: actions/checkout@v4
# with:
# ref: ${{ github.head_ref }}

- name: Setup Python based on matrix
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Execute setup script for configuration, asumes frontend as project directory
run: python setup_project.py --project_dir 'frontend'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need to create the new project here


- name: Set up Node.js based on matrix
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies from frontend
run: |
cd frontend
npm install

- name: Build project, sets CI as empty string to not treat warnings as errors
run:
npm run --prefix frontend build
env:
CI: ""

- name: Tag build with timestamp and move into assets folder inside frontend
run: |
cd frontend
timestamp=$(date +'%Y%m%dT%H%M%S') # Generate timestamp
mv build $timestamp
mv $timestamp src/assets/$timestamp

# - name: Commit all changed files back to the repository
# uses: stefanzweifel/git-auto-commit-action@v5