Create web-deploy-nonprod.yml
This commit is contained in:
parent
47dce7bfc8
commit
13b92f69d0
1 changed files with 53 additions and 0 deletions
53
.github/workflows/web-deploy-nonprod.yml
vendored
Normal file
53
.github/workflows/web-deploy-nonprod.yml
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
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'
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
if: inputs.workflow_type != 'release'
|
||||||
|
environment: dev
|
||||||
|
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 TEST=${{ secrets.TEST }}
|
||||||
|
- name: Docker Push Backend
|
||||||
|
run: docker push john4064/shiftsync:latest_web
|
||||||
|
deploy:
|
||||||
|
needs: build
|
||||||
|
if: needs.build.result == 'success' && inputs.workflow_type != 'release'
|
||||||
|
environment: dev
|
||||||
|
runs-on: 'ubuntu-latest'
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
- name: Deploy to Coolify
|
||||||
|
run: |
|
||||||
|
echo ${{ needs.determine-workflow.outputs.workflow_type }}
|
||||||
|
curl --request GET '${{ secrets.COOLIFY_WEBHOOK }}' --header 'Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}'
|
||||||
|
|
||||||
Loading…
Reference in a new issue