push version #8
2 changed files with 37 additions and 1 deletions
37
.github/workflows/web-deploy.yml
vendored
37
.github/workflows/web-deploy.yml
vendored
|
|
@ -1,6 +1,16 @@
|
|||
name: Web Deployment
|
||||
on:
|
||||
workflow_dispatch: {}
|
||||
workflow_call:
|
||||
inputs:
|
||||
develop-environments:
|
||||
type: string
|
||||
description: An optional list of dev environments to deploy to.
|
||||
default: '["dev"]'
|
||||
release-environments:
|
||||
type: string
|
||||
description: An optional list of release environments to deploy to.
|
||||
default: '["prod"]'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
|
@ -15,8 +25,33 @@ on:
|
|||
paths:
|
||||
- web/**
|
||||
jobs:
|
||||
determine-workflow:
|
||||
runs-on: 'ubuntu-latest'
|
||||
outputs:
|
||||
workflow_type: ${{ steps.workflow.outputs.workflow_type }}
|
||||
workflow_envs: ${{ steps.workflow.outputs.workflow_envs }}
|
||||
release_type: ${{ steps.workflow.outputs.release_type }}
|
||||
steps:
|
||||
- name: Determine Workflow
|
||||
id: workflow
|
||||
shell: bash
|
||||
run: |
|
||||
event=${{ github.event_name }}
|
||||
workflow_type='dev';
|
||||
workflow_envs='${{ inputs.develop-environments }}'
|
||||
if [[ $event == 'workflow_dispatch' && ${{ github.ref_name }}' == 'main' ]];
|
||||
then
|
||||
workflow_type='release';
|
||||
workflow_envs='${{ inputs.release-environments }}'
|
||||
fi
|
||||
|
||||
echo "workflow_type=$workflow_type" >> $GITHUB_OUTPUT
|
||||
echo "workflow_envs=$workflow_envs" >> $GITHUB_OUTPUT
|
||||
|
||||
echo "Running #workflow_type pipeline in environments: $workflow_envs" >> $GITHUB_STEP_SUMMARY
|
||||
build:
|
||||
environment: dev
|
||||
needs: determine-workflow
|
||||
runs-on: 'ubuntu-latest'
|
||||
permissions:
|
||||
contents: read
|
||||
|
|
@ -36,7 +71,7 @@ jobs:
|
|||
deploy:
|
||||
environment: dev
|
||||
needs: build
|
||||
if: always() && needs.build.result == 'success'
|
||||
if: always() && needs.build.result == 'success' && ${{ steps.workflow.outputs.workflow_type }} == 'release'
|
||||
runs-on: 'ubuntu-latest'
|
||||
permissions:
|
||||
contents: read
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ RUN npm ci
|
|||
COPY . ./
|
||||
|
||||
EXPOSE 5173
|
||||
EXPOSE 5171
|
||||
|
||||
|
||||
CMD ["npm", "run", "dev"]
|
||||
|
|
|
|||
Loading…
Reference in a new issue