Build and Release #526
Workflow file for this run
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
name: Build and Release | |
on: | |
workflow_dispatch: | |
inputs: | |
auto_deploy: | |
type: choice | |
description: Auto deploy to (NONE/UAT/PRD) | |
options: | |
- PRD | |
- UAT | |
- NONE | |
default: NONE | |
required: true | |
bump_version: | |
type: choice | |
description: Bump version | |
options: | |
- patch | |
- minor | |
- major | |
default: patch | |
required: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- run: npm ci | |
- run: npm i rollup | |
- name: Optimize SVGs in public/images/facilities | |
working-directory: public/images/facilities | |
run: | | |
npm i -g svgo | |
svgo -v | |
svgo -f ./ --pretty --indent 2 --config ./svgo.config.js | |
# changes should be made before build.sh as they will be committed in build.sh | |
- name: Build | |
id: build | |
run: ./scripts/build.sh | |
shell: bash | |
env: | |
BUMP_VERSION: ${{ inputs.bump_version }} | |
- name: Release | |
if: ${{ inputs.auto_deploy == 'UAT' || inputs.auto_deploy == 'PRD' }} | |
uses: railmapgen/releaser@main | |
with: | |
app_name: rmp | |
version: ${{ steps.build.outputs.RMG_VER }} | |
environment: ${{ inputs.auto_deploy }} | |
dist: dist | |
github_token: ${{ secrets.RMG_BUILD_AND_RELEASE }} | |
gitlab_token: ${{ secrets.GITLAB_RELEASE }} |