Test deploy #31
8 changed files with 199 additions and 197 deletions
4
.github/workflows/api-container.yml
vendored
4
.github/workflows/api-container.yml
vendored
|
|
@ -18,7 +18,7 @@ on:
|
|||
- api/**
|
||||
jobs:
|
||||
determine-workflow:
|
||||
runs-on: 'ubuntu-latest'
|
||||
runs-on: ['self-hosted','pi']
|
||||
outputs:
|
||||
workflow_type: ${{ steps.workflow.outputs.workflow_type }}
|
||||
workflow_envs: ${{ steps.workflow.outputs.workflow_envs }}
|
||||
|
|
@ -45,6 +45,8 @@ jobs:
|
|||
echo "workflow_envs=$workflow_envs" >> $GITHUB_OUTPUT
|
||||
|
||||
echo "Running $workflow_type pipeline in environments: $workflow_envs" >> $GITHUB_STEP_SUMMARY
|
||||
- name: Install jq
|
||||
run: sudo apt-get update && sudo apt-get install -y jq
|
||||
- name: Extract Version
|
||||
id: version
|
||||
shell: bash
|
||||
|
|
|
|||
6
.github/workflows/api-deploy-nonprod.yml
vendored
6
.github/workflows/api-deploy-nonprod.yml
vendored
|
|
@ -26,7 +26,7 @@ on:
|
|||
COOLIFY_TOKEN: {}
|
||||
jobs:
|
||||
check-inputs:
|
||||
runs-on: 'ubuntu-latest'
|
||||
runs-on: ['self-hosted','pi']
|
||||
environment: ${{ inputs.environments }}
|
||||
steps:
|
||||
- name: Check secrets present
|
||||
|
|
@ -60,7 +60,7 @@ jobs:
|
|||
needs: check-inputs
|
||||
if: needs.check-inputs.result == 'success' && inputs.workflow_type != 'release'
|
||||
environment: ${{ inputs.environments }}
|
||||
runs-on: 'ubuntu-latest'
|
||||
runs-on: ['self-hosted','pi']
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
|
@ -83,7 +83,7 @@ jobs:
|
|||
needs: build
|
||||
if: needs.build.result == 'success' && inputs.workflow_type != 'release'
|
||||
environment: ${{ inputs.environments }}
|
||||
runs-on: 'ubuntu-latest'
|
||||
runs-on: ['self-hosted','pi']
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
|
|
|||
6
.github/workflows/api-deploy-prod.yml
vendored
6
.github/workflows/api-deploy-prod.yml
vendored
|
|
@ -26,7 +26,7 @@ on:
|
|||
COOLIFY_TOKEN: {}
|
||||
jobs:
|
||||
check-inputs:
|
||||
runs-on: 'ubuntu-latest'
|
||||
runs-on: ['self-hosted','pi']
|
||||
environment: ${{ inputs.environments }}
|
||||
steps:
|
||||
- name: Check secrets present
|
||||
|
|
@ -60,7 +60,7 @@ jobs:
|
|||
needs: check-inputs
|
||||
if: needs.check-inputs.result == 'success' && inputs.workflow_type == 'release'
|
||||
environment: ${{ inputs.environments }}
|
||||
runs-on: 'ubuntu-latest'
|
||||
runs-on: ['self-hosted','pi']
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
|
@ -83,7 +83,7 @@ jobs:
|
|||
needs: build
|
||||
if: needs.build.result == 'success' && inputs.workflow_type == 'release'
|
||||
environment: ${{ inputs.environments }}
|
||||
runs-on: 'ubuntu-latest'
|
||||
runs-on: ['self-hosted','pi']
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
|
|
|||
2
.github/workflows/web-container.yml
vendored
2
.github/workflows/web-container.yml
vendored
|
|
@ -45,6 +45,8 @@ jobs:
|
|||
echo "workflow_envs=$workflow_envs" >> $GITHUB_OUTPUT
|
||||
|
||||
echo "Running $workflow_type pipeline in environments: $workflow_envs" >> $GITHUB_STEP_SUMMARY
|
||||
- name: Install jq
|
||||
run: sudo apt-get update && sudo apt-get install -y jq
|
||||
- name: Extract Version
|
||||
id: version
|
||||
shell: bash
|
||||
|
|
|
|||
187
.github/workflows/web-deploy-nonprod.yml
vendored
187
.github/workflows/web-deploy-nonprod.yml
vendored
|
|
@ -1,94 +1,93 @@
|
|||
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 --request GET '${{ 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: {}
|
||||
COOLIFY_WEBHOOK_WEB: {}
|
||||
COOLIFY_TOKEN: {}
|
||||
jobs:
|
||||
check-inputs:
|
||||
runs-on: ['self-hosted','pi']
|
||||
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: ['self-hosted','pi']
|
||||
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: ['self-hosted','pi']
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Deploy to Coolify
|
||||
run: |
|
||||
curl -X GET '${{ secrets.COOLIFY_WEBHOOK_WEB }}' --header 'Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}'
|
||||
|
|
|
|||
187
.github/workflows/web-deploy-prod.yml
vendored
187
.github/workflows/web-deploy-prod.yml
vendored
|
|
@ -1,94 +1,93 @@
|
|||
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 --request GET '${{ 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: {}
|
||||
COOLIFY_WEBHOOK_WEB: {}
|
||||
COOLIFY_TOKEN: {}
|
||||
jobs:
|
||||
check-inputs:
|
||||
runs-on: ['self-hosted','pi']
|
||||
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: ['self-hosted','pi']
|
||||
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: ['self-hosted','pi']
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Deploy to Coolify
|
||||
run: |
|
||||
curl -X GET '${{ secrets.COOLIFY_WEBHOOK_WEB }}' --header 'Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "shiftsync-website-api",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.6",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "shiftsync-website-web",
|
||||
"version": "1.0.6",
|
||||
"private": true,
|
||||
"version": "1.0.5",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"local": "vite",
|
||||
|
|
|
|||
Loading…
Reference in a new issue