-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created gh action for building production.
- Loading branch information
1 parent
eeb9cc8
commit ce25fe0
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Production Build | ||
|
||
# Controls when the action will run. | ||
on: | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Set shared environment variables | ||
env: | ||
APP_VERSION: 2.4.0 | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
environment: production | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v4 | ||
|
||
# Set up node and npm | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
|
||
- name: Install dependencies | ||
run: npm install --omit=dev | ||
working-directory: app | ||
|
||
- name: Run tests | ||
run: npm test | ||
working-directory: app | ||
|
||
- name: Remove unnecessary server app files | ||
run: rm -rf prettier.config.js manifest-dev.yml manifest-staging.yml | ||
working-directory: app | ||
|
||
- name: Create production artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: lew_v${{ env.APP_VERSION }} | ||
path: app |