Compare commits

..

52 commits

Author SHA1 Message Date
427f6bbf43
Merge pull request #31 from Doble-Technologies/test-deploy
Test deploy
2026-03-04 00:20:20 -05:00
23a330773d Test 2026-02-10 00:29:32 -05:00
bf1211c081 Update package.json 2026-02-08 11:18:02 -05:00
6b212916ac Version Bump 2026-02-08 00:10:21 -05:00
273adc2dad Add null 2026-02-08 00:07:47 -05:00
a30ef20551 null? 2026-02-08 00:05:46 -05:00
2658991dd7 Retry -s 2026-02-07 23:58:19 -05:00
54cb49dd8a Change to grep 2026-02-07 23:55:12 -05:00
0e0a5a8b87 Trying new 2026-02-07 23:53:05 -05:00
fbf198a6c0 Return less fields 2026-02-07 23:46:36 -05:00
3bbe2d6287 Update Buildtype to JSON 2026-02-07 23:40:01 -05:00
ad5e5f31e8 JSON Headers 2026-02-07 23:36:18 -05:00
9a5c995e45 Header change 2026-02-07 23:33:21 -05:00
faa687f71d Fixing Headers 2026-02-07 23:30:04 -05:00
5479b1efe3 Fix Content Headers 2026-02-07 23:25:54 -05:00
8d61fd54cd Update to TeamCity 2026-02-07 23:17:39 -05:00
1eefceed65
Bump version from 1.0.6 to 1.0.7 2026-02-07 14:17:53 -05:00
c46860ac6b
Bump version from 1.0.9 to 1.0.10 2026-02-07 14:17:26 -05:00
46cc988282 update package-locks 2026-02-07 13:31:47 -05:00
3719bb6648 Update package.json 2026-02-07 12:49:49 -05:00
3911e7fd26 Update package.json 2026-02-07 12:19:53 -05:00
4419ad7ab5 Yup 2026-02-07 12:06:35 -05:00
e3f86e85ab wip? 2026-02-07 12:02:12 -05:00
96df444d8a
Add parse (#30)
* Add parse

* Fix Errors
2026-01-23 01:21:47 -05:00
2bb473e569 Update api-deploy-nonprod.yml 2026-01-19 23:21:48 -05:00
49a5389ab0 Update api-deploy-nonprod.yml 2026-01-19 23:10:17 -05:00
bcc9ffff74 Add auto-read api/version 2026-01-19 22:43:39 -05:00
db509a61bb Update server.js 2026-01-19 20:15:05 -05:00
60a41d738b Update server.js 2026-01-19 19:28:07 -05:00
ca19bc06ff Update package-lock.json 2026-01-19 19:08:45 -05:00
7131a9bb83 Merge branch 'test-deploy' of https://github.com/Doble-Technologies/ShiftSync-Website into test-deploy 2026-01-19 19:06:58 -05:00
cb06adb097 Update server.js 2026-01-19 19:06:34 -05:00
d73b241c65 Remove self hosted. 2026-01-19 18:59:29 -05:00
258665eb34 Update server.js 2026-01-19 18:56:56 -05:00
0f063071a5 Update server.js 2026-01-19 17:40:15 -05:00
1b6c95bf95 try runners 2026-01-19 17:15:11 -05:00
616cc00bcf Revert DockerFiles, due to error in coolify 2026-01-19 17:08:07 -05:00
4be81eada6 remove arm 2026-01-19 17:05:36 -05:00
39e736ddad Fix Docker FIles 2026-01-19 17:01:41 -05:00
3c401b4ce0 Fix DockerFile Warnings and remove Cache stuff 2026-01-19 16:56:52 -05:00
c5408599ba Vuln and Package fixes 2026-01-19 16:51:11 -05:00
43f4be8d0e Fix Docker Files 2026-01-19 16:46:01 -05:00
d03e81c939 Ver Bump | Web Fixes | Runner Changes 2026-01-19 15:57:21 -05:00
1f3bbc8d40 Fix prod/nonprod 2026-01-19 15:46:42 -05:00
1fc6b5a30c Update server.js 2026-01-19 15:23:39 -05:00
9847a7271e Change paths 2026-01-19 13:58:45 -05:00
2aebe713c1
Merge branch 'main' into test-deploy 2026-01-19 13:52:21 -05:00
ecce459d71 Update server.js 2026-01-19 00:40:06 -05:00
6e4a2f56cc Update server.js 2026-01-19 00:20:21 -05:00
f5b59193d0 Update server.js 2026-01-18 18:46:17 -05:00
866ca6a557 Update server.js 2026-01-18 17:56:34 -05:00
218d7d094e Update server.js 2026-01-18 17:20:55 -05:00
16 changed files with 7297 additions and 1972 deletions

View file

@ -1,95 +1,101 @@
name: API Deployment Container
on:
workflow_dispatch: {}
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- ready_for_review
push:
branches:
- main
paths:
- api/**
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 }}
current_version: ${{ steps.version.outputs.current_version }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Determine Workflow
id: workflow
shell: bash
run: |
event=${{ github.event_name }}
workflow_type='dev';
workflow_envs='["dev"]'
if [[ $event == 'workflow_dispatch' && '${{ github.ref_name }}' == 'main' ]];
then
echo "in if statement"
workflow_type='release';
workflow_envs='["prod"]'
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
- name: Extract Version
id: version
shell: bash
run: |
version=$(jq -r '.version' api/package.json)
echo "current_version=$version" >> "$GITHUB_OUTPUT"
nonprod-deploy:
needs: determine-workflow
if: needs.determine-workflow.outputs.workflow_type != 'release'
strategy:
max-parallel: 1
matrix:
env: ${{ fromJson(needs.determine-workflow.outputs.workflow_envs) }}
uses: ./.github/workflows/api-deploy-nonprod.yml
with:
environments: ${{ matrix.env }}
workflow_type: ${{ needs.determine-workflow.outputs.workflow_type }}
branch: ${{ github.head_ref || github.ref_name }}
current_version: ${{ needs.determine-workflow.outputs.current_version }}
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
TEST: ${{ secrets.TEST }}
COOLIFY_WEBHOOK_API: ${{ secrets.COOLIFY_WEBHOOK_API }}
COOLIFY_TOKEN: ${{ secrets.COOLIFY_TOKEN }}
permissions:
contents: read
packages: write
prod-deploy:
needs: determine-workflow
if: needs.determine-workflow.outputs.workflow_type == 'release'
strategy:
max-parallel: 1
matrix:
env: ${{ fromJson(needs.determine-workflow.outputs.workflow_envs) }}
uses: ./.github/workflows/api-deploy-prod.yml
with:
environments: ${{ matrix.env }}
workflow_type: ${{ needs.determine-workflow.outputs.workflow_type }}
branch: ${{ github.head_ref || github.ref_name }}
current_version: ${{ needs.determine-workflow.outputs.current_version }}
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
TEST: ${{ secrets.TEST }}
COOLIFY_WEBHOOK_API: ${{ secrets.COOLIFY_WEBHOOK_API }}
COOLIFY_TOKEN: ${{ secrets.COOLIFY_TOKEN }}
permissions:
contents: read
packages: write
name: API Deployment Container
on:
workflow_dispatch: {}
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- ready_for_review
paths:
- api/**
push:
branches:
- main
paths:
- api/**
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 }}
current_version: ${{ steps.version.outputs.current_version }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Determine Workflow
id: workflow
shell: bash
run: |
event=${{ github.event_name }}
workflow_type='dev';
workflow_envs='["dev"]'
if [[ $event == 'workflow_dispatch' && '${{ github.ref_name }}' == 'main' ]];
then
echo "in if statement"
workflow_type='release';
workflow_envs='["prod"]'
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
- name: Extract Version
id: version
shell: bash
run: |
version=$(jq -r '.version' api/package.json)
echo "current_version=$version" >> "$GITHUB_OUTPUT"
nonprod-deploy:
needs: determine-workflow
if: needs.determine-workflow.outputs.workflow_type != 'release'
strategy:
max-parallel: 1
matrix:
env: ${{ fromJson(needs.determine-workflow.outputs.workflow_envs) }}
uses: ./.github/workflows/api-deploy-nonprod.yml
with:
environments: ${{ matrix.env }}
workflow_type: ${{ needs.determine-workflow.outputs.workflow_type }}
branch: ${{ github.head_ref || github.ref_name }}
current_version: ${{ needs.determine-workflow.outputs.current_version }}
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
TEST: ${{ secrets.TEST }}
TEAMCITY_API_ID: ${{ secrets.TEAMCITY_API_ID }}
TEAMCITY_URL: ${{ secrets.TEAMCITY_URL }}
TEAMCITY_USERNAME: ${{ secrets.TEAMCITY_USERNAME }}
TEAMCITY_PASSWORD: ${{ secrets.TEAMCITY_PASSWORD }}
permissions:
contents: read
packages: write
prod-deploy:
needs: determine-workflow
if: needs.determine-workflow.outputs.workflow_type == 'release'
strategy:
max-parallel: 1
matrix:
env: ${{ fromJson(needs.determine-workflow.outputs.workflow_envs) }}
uses: ./.github/workflows/api-deploy-prod.yml
with:
environments: ${{ matrix.env }}
workflow_type: ${{ needs.determine-workflow.outputs.workflow_type }}
branch: ${{ github.head_ref || github.ref_name }}
current_version: ${{ needs.determine-workflow.outputs.current_version }}
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
TEST: ${{ secrets.TEST }}
TEAMCITY_API_ID: ${{ secrets.TEAMCITY_API_ID }}
TEAMCITY_URL: ${{ secrets.TEAMCITY_URL }}
TEAMCITY_USERNAME: ${{ secrets.TEAMCITY_USERNAME }}
TEAMCITY_PASSWORD: ${{ secrets.TEAMCITY_PASSWORD }}
permissions:
contents: read
packages: write

View file

@ -22,8 +22,10 @@ on:
DOCKERHUB_USER: {}
DOCKERHUB_TOKEN: {}
TEST: {}
COOLIFY_WEBHOOK_API: {}
COOLIFY_TOKEN: {}
TEAMCITY_API_ID: {}
TEAMCITY_URL: {}
TEAMCITY_USERNAME: {}
TEAMCITY_PASSWORD: {}
jobs:
check-inputs:
runs-on: 'ubuntu-latest'
@ -31,17 +33,29 @@ jobs:
steps:
- name: Check secrets present
run: |
if [[ -z "${{ secrets.COOLIFY_WEBHOOK_API }}" ]]; then
echo "COOLIFY_WEBHOOK_API secret is empty or missing"
if [[ -z "${{ secrets.TEAMCITY_API_ID }}" ]]; then
echo "TEAMCITY_API_ID secret is empty or missing"
exit 1
else
echo "COOLIFY_WEBHOOK_API secret is set"
echo "TEAMCITY_API_ID secret is set"
fi
if [[ -z "${{ secrets.COOLIFY_TOKEN }}" ]]; then
echo "COOLIFY_TOKEN secret is empty or missing"
if [[ -z "${{ secrets.TEAMCITY_URL }}" ]]; then
echo "TEAMCITY_URL secret is empty or missing"
exit 1
else
echo "COOLIFY_TOKEN secret is set"
echo "TEAMCITY_URL secret is set"
fi
if [[ -z "${{ secrets.TEAMCITY_USERNAME }}" ]]; then
echo "TEAMCITY_USERNAME secret is empty or missing"
exit 1
else
echo "TEAMCITY_USERNAME secret is set"
fi
if [[ -z "${{ secrets.TEAMCITY_PASSWORD }}" ]]; then
echo "TEAMCITY_PASSWORD secret is empty or missing"
exit 1
else
echo "TEAMCITY_PASSWORD secret is set"
fi
if [[ -z "${{ secrets.DOCKERHUB_USER }}" ]]; then
echo "DOCKERHUB_USER secret is empty or missing"
@ -88,7 +102,12 @@ jobs:
contents: read
packages: write
steps:
- name: Deploy to Coolify
- name: Deploy to Team City
run: |
curl '${{ secrets.COOLIFY_WEBHOOK_API }}' --header 'Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}'
curl -u ${{ secrets.TEAMCITY_USERNAME }}:${{ secrets.TEAMCITY_PASSWORD }} \
-X POST \
-H "Content-Type: application/json" \
-d '{"buildType": {"id": "${{ secrets.TEAMCITY_API_ID }}"}}' \
"${{ secrets.TEAMCITY_URL }}/httpAuth/app/rest/buildQueue" > /dev/null

View file

@ -1,94 +1,111 @@
name: API Deployment Production
on:
workflow_call:
inputs:
environments:
type: string
description: An optional list of environments to deploy to.
default: 'prod'
workflow_type:
type: string
description: An optional string for workflow types.
default: 'prod'
branch:
type: string
description: An optional string to define which branch to checkout.
default: 'main'
current_version:
type: string
description: Current Version of the package.json.
default: '0.0.0'
secrets:
DOCKERHUB_USER: {}
DOCKERHUB_TOKEN: {}
TEST: {}
COOLIFY_WEBHOOK_API: {}
COOLIFY_TOKEN: {}
jobs:
check-inputs:
runs-on: 'ubuntu-latest'
environment: ${{ inputs.environments }}
steps:
- name: Check secrets present
run: |
if [[ -z "${{ secrets.COOLIFY_WEBHOOK_API }}" ]]; then
echo "COOLIFY_WEBHOOK_API secret is empty or missing"
exit 1
else
echo "COOLIFY_WEBHOOK_API secret is set"
fi
if [[ -z "${{ secrets.COOLIFY_TOKEN }}" ]]; then
echo "COOLIFY_TOKEN secret is empty or missing"
exit 1
else
echo "COOLIFY_TOKEN secret is set"
fi
if [[ -z "${{ secrets.DOCKERHUB_USER }}" ]]; then
echo "DOCKERHUB_USER secret is empty or missing"
exit 1
else
echo "DOCKERHUB_USER secret is set"
fi
if [[ -z "${{ secrets.DOCKERHUB_TOKEN }}" ]]; then
echo "DOCKERHUB_TOKEN secret is empty or missing"
exit 1
else
echo "DOCKERHUB_TOKEN secret is set"
fi
echo "Current Version: ${{inputs.current_version}}"
build:
needs: check-inputs
if: needs.check-inputs.result == 'success' && inputs.workflow_type == 'release'
environment: ${{ inputs.environments }}
runs-on: 'ubuntu-latest'
permissions:
contents: read
packages: write
steps:
- name: Branch Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Login to Docker
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Build Backend
run: docker build -f api/Dockerfile -t john4064/shiftsync:prod_api ./api --build-arg ENVIRONMENT=prod
- name: Docker Push Backend
run: docker push john4064/shiftsync:prod_api
deploy:
needs: build
if: needs.build.result == 'success' && inputs.workflow_type == 'release'
environment: ${{ inputs.environments }}
runs-on: 'ubuntu-latest'
permissions:
contents: read
packages: write
steps:
- name: Deploy to Coolify
run: |
curl '${{ secrets.COOLIFY_WEBHOOK_API }}' --header 'Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}'
name: API Deployment Production
on:
workflow_call:
inputs:
environments:
type: string
description: An optional list of environments to deploy to.
default: 'prod'
workflow_type:
type: string
description: An optional string for workflow types.
default: 'prod'
branch:
type: string
description: An optional string to define which branch to checkout.
default: 'main'
current_version:
type: string
description: Current Version of the package.json.
default: '0.0.0'
secrets:
DOCKERHUB_USER: {}
DOCKERHUB_TOKEN: {}
TEST: {}
TEAMCITY_API_ID: {}
TEAMCITY_URL: {}
TEAMCITY_USERNAME: {}
TEAMCITY_PASSWORD: {}
jobs:
check-inputs:
runs-on: 'ubuntu-latest'
environment: ${{ inputs.environments }}
steps:
- name: Check secrets present
run: |
if [[ -z "${{ secrets.TEAMCITY_API_ID }}" ]]; then
echo "TEAMCITY_API_ID secret is empty or missing"
exit 1
else
echo "TEAMCITY_API_ID secret is set"
fi
if [[ -z "${{ secrets.TEAMCITY_URL }}" ]]; then
echo "TEAMCITY_URL secret is empty or missing"
exit 1
else
echo "TEAMCITY_URL secret is set"
fi
if [[ -z "${{ secrets.TEAMCITY_USERNAME }}" ]]; then
echo "TEAMCITY_USERNAME secret is empty or missing"
exit 1
else
echo "TEAMCITY_USERNAME secret is set"
fi
if [[ -z "${{ secrets.TEAMCITY_PASSWORD }}" ]]; then
echo "TEAMCITY_PASSWORD secret is empty or missing"
exit 1
else
echo "TEAMCITY_PASSWORD secret is set"
fi
if [[ -z "${{ secrets.DOCKERHUB_USER }}" ]]; then
echo "DOCKERHUB_USER secret is empty or missing"
exit 1
else
echo "DOCKERHUB_USER secret is set"
fi
if [[ -z "${{ secrets.DOCKERHUB_TOKEN }}" ]]; then
echo "DOCKERHUB_TOKEN secret is empty or missing"
exit 1
else
echo "DOCKERHUB_TOKEN secret is set"
fi
echo "Current Version: ${{inputs.current_version}}"
build:
needs: check-inputs
if: needs.check-inputs.result == 'success' && inputs.workflow_type == 'release'
environment: ${{ inputs.environments }}
runs-on: 'ubuntu-latest'
permissions:
contents: read
packages: write
steps:
- name: Branch Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Login to Docker
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Build Backend
run: docker build -f api/Dockerfile -t john4064/shiftsync:prod_api ./api --build-arg ENVIRONMENT=prod
- name: Docker Push Backend
run: docker push john4064/shiftsync:prod_api
deploy:
needs: build
if: needs.build.result == 'success' && inputs.workflow_type == 'release'
environment: ${{ inputs.environments }}
runs-on: 'ubuntu-latest'
permissions:
contents: read
packages: write
steps:
- name: Deploy to Team City
run: |
curl -u ${{ secrets.TEAMCITY_USERNAME }}:${{ secrets.TEAMCITY_PASSWORD }} \
-X POST \
-H "Content-Type: application/json" \
-d '{"buildType": {"id": "${{ secrets.TEAMCITY_API_ID }}"}}' \
"${{ secrets.TEAMCITY_URL }}/httpAuth/app/rest/buildQueue" > /dev/null

View file

@ -1,19 +1,19 @@
name: PR Validation
on:
pull_request:
types: [opened]
permissions:
contents: read
jobs:
pr-validation:
permissions:
contents: read
pull-requests: write
runs-on: ['self-hosted', 'pi']
steps:
- uses: TimonVS/pr-labeler-action@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/configs/pr-labeler-configuration.yml
name: PR Validation
on:
pull_request:
types: [opened]
permissions:
contents: read
jobs:
pr-validation:
permissions:
contents: read
pull-requests: write
runs-on: 'ubuntu-latest'
steps:
- uses: TimonVS/pr-labeler-action@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/configs/pr-labeler-configuration.yml

View file

@ -9,6 +9,8 @@ on:
- reopened
- synchronize
- ready_for_review
paths:
- web/**
push:
branches:
- main
@ -16,7 +18,7 @@ on:
- web/**
jobs:
determine-workflow:
runs-on: ['self-hosted','pi']
runs-on: 'ubuntu-latest'
outputs:
workflow_type: ${{ steps.workflow.outputs.workflow_type }}
workflow_envs: ${{ steps.workflow.outputs.workflow_envs }}
@ -66,8 +68,10 @@ jobs:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
TEST: ${{ secrets.TEST }}
COOLIFY_WEBHOOK_WEB: ${{ secrets.COOLIFY_WEBHOOK_WEB }}
COOLIFY_TOKEN: ${{ secrets.COOLIFY_TOKEN }}
TEAMCITY_WEB_ID: ${{ secrets.TEAMCITY_WEB_ID }}
TEAMCITY_URL: ${{ secrets.TEAMCITY_URL }}
TEAMCITY_USERNAME: ${{ secrets.TEAMCITY_USERNAME }}
TEAMCITY_PASSWORD: ${{ secrets.TEAMCITY_PASSWORD }}
permissions:
contents: read
packages: write
@ -88,8 +92,10 @@ jobs:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
TEST: ${{ secrets.TEST }}
COOLIFY_WEBHOOK_WEB: ${{ secrets.COOLIFY_WEBHOOK_WEB }}
COOLIFY_TOKEN: ${{ secrets.COOLIFY_TOKEN }}
TEAMCITY_WEB_ID: ${{ secrets.TEAMCITY_WEB_ID }}
TEAMCITY_URL: ${{ secrets.TEAMCITY_URL }}
TEAMCITY_USERNAME: ${{ secrets.TEAMCITY_USERNAME }}
TEAMCITY_PASSWORD: ${{ secrets.TEAMCITY_PASSWORD }}
permissions:
contents: read
packages: write

View file

@ -1,94 +1,111 @@
name: Web Deployment Non-Production
on:
workflow_call:
inputs:
environments:
type: string
description: An optional list of environments to deploy to.
default: 'dev'
workflow_type:
type: string
description: An optional string for workflow types.
default: 'dev'
branch:
type: string
description: An optional string to define which branch to checkout.
default: 'main'
current_version:
type: string
description: Current Version of the package.json.
default: '0.0.0'
secrets:
DOCKERHUB_USER: {}
DOCKERHUB_TOKEN: {}
TEST: {}
COOLIFY_WEBHOOK_WEB: {}
COOLIFY_TOKEN: {}
jobs:
check-inputs:
runs-on: 'ubuntu-latest'
environment: ${{ inputs.environments }}
steps:
- name: Check secrets present
run: |
if [[ -z "${{ secrets.COOLIFY_WEBHOOK_WEB }}" ]]; then
echo "COOLIFY_WEBHOOK_WEB secret is empty or missing"
exit 1
else
echo "COOLIFY_WEBHOOK_WEB secret is set"
fi
if [[ -z "${{ secrets.COOLIFY_TOKEN }}" ]]; then
echo "COOLIFY_TOKEN secret is empty or missing"
exit 1
else
echo "COOLIFY_TOKEN secret is set"
fi
if [[ -z "${{ secrets.DOCKERHUB_USER }}" ]]; then
echo "DOCKERHUB_USER secret is empty or missing"
exit 1
else
echo "DOCKERHUB_USER secret is set"
fi
if [[ -z "${{ secrets.DOCKERHUB_TOKEN }}" ]]; then
echo "DOCKERHUB_TOKEN secret is empty or missing"
exit 1
else
echo "DOCKERHUB_TOKEN secret is set"
fi
echo "Current Version: ${{inputs.current_version}}"
build:
needs: check-inputs
if: needs.check-inputs.result == 'success' && inputs.workflow_type != 'release'
environment: ${{ inputs.environments }}
runs-on: 'ubuntu-latest'
permissions:
contents: read
packages: write
steps:
- name: Branch Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Login to Docker
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Build Backend
run: docker build -f web/Dockerfile -t john4064/shiftsync:latest_web ./web --build-arg ENVIRONMENT=dev
- name: Docker Push Backend
run: docker push john4064/shiftsync:latest_web
deploy:
needs: build
if: needs.build.result == 'success' && inputs.workflow_type != 'release'
environment: ${{ inputs.environments }}
runs-on: 'ubuntu-latest'
permissions:
contents: read
packages: write
steps:
- name: Deploy to Coolify
run: |
curl '${{ secrets.COOLIFY_WEBHOOK_WEB }}' --header 'Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}'
name: Web Deployment Non-Production
on:
workflow_call:
inputs:
environments:
type: string
description: An optional list of environments to deploy to.
default: 'dev'
workflow_type:
type: string
description: An optional string for workflow types.
default: 'dev'
branch:
type: string
description: An optional string to define which branch to checkout.
default: 'main'
current_version:
type: string
description: Current Version of the package.json.
default: '0.0.0'
secrets:
DOCKERHUB_USER: {}
DOCKERHUB_TOKEN: {}
TEST: {}
TEAMCITY_WEB_ID: {}
TEAMCITY_URL: {}
TEAMCITY_USERNAME: {}
TEAMCITY_PASSWORD: {}
jobs:
check-inputs:
runs-on: 'ubuntu-latest'
environment: ${{ inputs.environments }}
steps:
- name: Check secrets present
run: |
if [[ -z "${{ secrets.TEAMCITY_WEB_ID }}" ]]; then
echo "TEAMCITY_WEB_ID secret is empty or missing"
exit 1
else
echo "TEAMCITY_WEB_ID secret is set"
fi
if [[ -z "${{ secrets.TEAMCITY_URL }}" ]]; then
echo "TEAMCITY_URL secret is empty or missing"
exit 1
else
echo "TEAMCITY_URL secret is set"
fi
if [[ -z "${{ secrets.TEAMCITY_USERNAME }}" ]]; then
echo "TEAMCITY_USERNAME secret is empty or missing"
exit 1
else
echo "TEAMCITY_USERNAME secret is set"
fi
if [[ -z "${{ secrets.TEAMCITY_PASSWORD }}" ]]; then
echo "TEAMCITY_PASSWORD secret is empty or missing"
exit 1
else
echo "TEAMCITY_PASSWORD secret is set"
fi
if [[ -z "${{ secrets.DOCKERHUB_USER }}" ]]; then
echo "DOCKERHUB_USER secret is empty or missing"
exit 1
else
echo "DOCKERHUB_USER secret is set"
fi
if [[ -z "${{ secrets.DOCKERHUB_TOKEN }}" ]]; then
echo "DOCKERHUB_TOKEN secret is empty or missing"
exit 1
else
echo "DOCKERHUB_TOKEN secret is set"
fi
echo "Current Version: ${{inputs.current_version}}"
build:
needs: check-inputs
if: needs.check-inputs.result == 'success' && inputs.workflow_type != 'release'
environment: ${{ inputs.environments }}
runs-on: 'ubuntu-latest'
permissions:
contents: read
packages: write
steps:
- name: Branch Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Login to Docker
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Build Backend
run: docker build -f web/Dockerfile -t john4064/shiftsync:latest_web ./web --build-arg ENVIRONMENT=dev
- name: Docker Push Backend
run: docker push john4064/shiftsync:latest_web
deploy:
needs: build
if: needs.build.result == 'success' && inputs.workflow_type != 'release'
environment: ${{ inputs.environments }}
runs-on: 'ubuntu-latest'
permissions:
contents: read
packages: write
steps:
- name: Deploy to Team City
run: |
curl -u ${{ secrets.TEAMCITY_USERNAME }}:${{ secrets.TEAMCITY_PASSWORD }} \
-X POST \
-H "Content-Type: application/json" \
-d '{"buildType": {"id": "${{ secrets.TEAMCITY_WEB_ID }}"}}' \
"${{ secrets.TEAMCITY_URL }}/httpAuth/app/rest/buildQueue" > /dev/null

View file

@ -1,94 +1,111 @@
name: Web Deployment Production
on:
workflow_call:
inputs:
environments:
type: string
description: An optional list of environments to deploy to.
default: 'prod'
workflow_type:
type: string
description: An optional string for workflow types.
default: 'prod'
branch:
type: string
description: An optional string to define which branch to checkout.
default: 'main'
current_version:
type: string
description: Current Version of the package.json.
default: '0.0.0'
secrets:
DOCKERHUB_USER: {}
DOCKERHUB_TOKEN: {}
TEST: {}
COOLIFY_WEBHOOK_WEB: {}
COOLIFY_TOKEN: {}
jobs:
check-inputs:
runs-on: 'ubuntu-latest'
environment: ${{ inputs.environments }}
steps:
- name: Check secrets present
run: |
if [[ -z "${{ secrets.COOLIFY_WEBHOOK_WEB }}" ]]; then
echo "COOLIFY_WEBHOOK_WEB secret is empty or missing"
exit 1
else
echo "COOLIFY_WEBHOOK_WEB secret is set"
fi
if [[ -z "${{ secrets.COOLIFY_TOKEN }}" ]]; then
echo "COOLIFY_TOKEN secret is empty or missing"
exit 1
else
echo "COOLIFY_TOKEN secret is set"
fi
if [[ -z "${{ secrets.DOCKERHUB_USER }}" ]]; then
echo "DOCKERHUB_USER secret is empty or missing"
exit 1
else
echo "DOCKERHUB_USER secret is set"
fi
if [[ -z "${{ secrets.DOCKERHUB_TOKEN }}" ]]; then
echo "DOCKERHUB_TOKEN secret is empty or missing"
exit 1
else
echo "DOCKERHUB_TOKEN secret is set"
fi
echo "Current Version: ${{inputs.current_version}}"
build:
needs: check-inputs
if: needs.check-inputs.result == 'success' && inputs.workflow_type == 'release'
environment: ${{ inputs.environments }}
runs-on: 'ubuntu-latest'
permissions:
contents: read
packages: write
steps:
- name: Branch Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Login to Docker
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Build Backend
run: docker build -f web/Dockerfile -t john4064/shiftsync:prod_web ./web --build-arg ENVIRONMENT=prod
- name: Docker Push Backend
run: docker push john4064/shiftsync:prod_web
deploy:
needs: build
if: needs.build.result == 'success' && inputs.workflow_type == 'release'
environment: ${{ inputs.environments }}
runs-on: 'ubuntu-latest'
permissions:
contents: read
packages: write
steps:
- name: Deploy to Coolify
run: |
curl '${{ secrets.COOLIFY_WEBHOOK_WEB }}' --header 'Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}'
name: Web Deployment Production
on:
workflow_call:
inputs:
environments:
type: string
description: An optional list of environments to deploy to.
default: 'prod'
workflow_type:
type: string
description: An optional string for workflow types.
default: 'prod'
branch:
type: string
description: An optional string to define which branch to checkout.
default: 'main'
current_version:
type: string
description: Current Version of the package.json.
default: '0.0.0'
secrets:
DOCKERHUB_USER: {}
DOCKERHUB_TOKEN: {}
TEST: {}
TEAMCITY_WEB_ID: {}
TEAMCITY_URL: {}
TEAMCITY_USERNAME: {}
TEAMCITY_PASSWORD: {}
jobs:
check-inputs:
runs-on: 'ubuntu-latest'
environment: ${{ inputs.environments }}
steps:
- name: Check secrets present
run: |
if [[ -z "${{ secrets.TEAMCITY_WEB_ID }}" ]]; then
echo "TEAMCITY_WEB_ID secret is empty or missing"
exit 1
else
echo "TEAMCITY_WEB_ID secret is set"
fi
if [[ -z "${{ secrets.TEAMCITY_URL }}" ]]; then
echo "TEAMCITY_URL secret is empty or missing"
exit 1
else
echo "TEAMCITY_URL secret is set"
fi
if [[ -z "${{ secrets.TEAMCITY_USERNAME }}" ]]; then
echo "TEAMCITY_USERNAME secret is empty or missing"
exit 1
else
echo "TEAMCITY_USERNAME secret is set"
fi
if [[ -z "${{ secrets.TEAMCITY_PASSWORD }}" ]]; then
echo "TEAMCITY_PASSWORD secret is empty or missing"
exit 1
else
echo "TEAMCITY_PASSWORD secret is set"
fi
if [[ -z "${{ secrets.DOCKERHUB_USER }}" ]]; then
echo "DOCKERHUB_USER secret is empty or missing"
exit 1
else
echo "DOCKERHUB_USER secret is set"
fi
if [[ -z "${{ secrets.DOCKERHUB_TOKEN }}" ]]; then
echo "DOCKERHUB_TOKEN secret is empty or missing"
exit 1
else
echo "DOCKERHUB_TOKEN secret is set"
fi
echo "Current Version: ${{inputs.current_version}}"
build:
needs: check-inputs
if: needs.check-inputs.result == 'success' && inputs.workflow_type == 'release'
environment: ${{ inputs.environments }}
runs-on: 'ubuntu-latest'
permissions:
contents: read
packages: write
steps:
- name: Branch Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Login to Docker
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Build Backend
run: docker build -f web/Dockerfile -t john4064/shiftsync:prod_web ./web --build-arg ENVIRONMENT=prod
- name: Docker Push Backend
run: docker push john4064/shiftsync:prod_web
deploy:
needs: build
if: needs.build.result == 'success' && inputs.workflow_type == 'release'
environment: ${{ inputs.environments }}
runs-on: 'ubuntu-latest'
permissions:
contents: read
packages: write
steps:
- name: Deploy to Team City
run: |
curl -u ${{ secrets.TEAMCITY_USERNAME }}:${{ secrets.TEAMCITY_PASSWORD }} \
-X POST \
-H "Content-Type: application/json" \
-d '{"buildType": {"id": "${{ secrets.TEAMCITY_WEB_ID }}"}}' \
"${{ secrets.TEAMCITY_URL }}/httpAuth/app/rest/buildQueue" > /dev/null

View file

@ -1,14 +1,14 @@
FROM node:20-alpine
WORKDIR /app
COPY ./package*.json ./
RUN npm cache clean --force && npm install --no-audit --no-fund
COPY . ./
EXPOSE 5172
EXPOSE 5170
CMD npm run dev
FROM node:20-alpine
WORKDIR /app
COPY ./package*.json ./
RUN npm ci
COPY . ./
EXPOSE 5172
EXPOSE 5170
CMD npm run dev

1403
api/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "shiftsync-website-api",
"version": "1.0.1",
"version": "1.0.11",
"private": true,
"type": "module",
"scripts": {

View file

@ -1,6 +1,7 @@
import express from 'express';
import cors from 'cors';
import dotenv from 'dotenv';
import fs from 'fs/promises';
import { medicationRouter } from './services/medications/index.js';
import { shiftsRouter } from './services/shifts/index.js';
import { shiftRunQuery } from './services/shiftConnection.js';
@ -45,9 +46,12 @@ app.get('/api/db-health', async (req, res) => {
res.status(500).json({ connected: false, error: err.message });
}
});
app.get('/api/version', async (req, res) => {
try {
res.json('1.0.1');
const packageData = await fs.readFile('./package.json', 'utf8');
const pkg = JSON.parse(packageData);
res.json(pkg.version);
} catch (err) {
console.error(err);
res.status(500).json({ connected: false, error: err.message });

3040
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,17 +1,17 @@
FROM node:20-alpine
WORKDIR /app
COPY ./package*.json ./
RUN npm cache clean --force && npm install --no-audit --no-fund
COPY . ./
EXPOSE 5173
EXPOSE 5171
ARG ENVIRONMENT
ENV ENVIRONMENT ${ENVIRONMENT}
CMD npm run ${ENVIRONMENT}
FROM node:20-alpine
WORKDIR /app
COPY ./package*.json ./
RUN npm ci
COPY . ./
EXPOSE 5173
EXPOSE 5171
ARG ENVIRONMENT
ENV ENVIRONMENT ${ENVIRONMENT}
CMD npm run ${ENVIRONMENT}

3845
web/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
{
"name": "shiftsync-website-web",
"version": "1.0.10",
"private": true,
"version": "1.0.5",
"type": "module",
"scripts": {
"local": "vite",

View file

@ -14,10 +14,11 @@ export const Home = () => {
}, []);
return (
<div>
<div >
<h1>Home Page</h1>
<Link to="/settings">Go to Settings</Link>
<p>Version: {pkg.version}</p>
<p>This site does nothing</p>
</div>
);
};