Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
87d11faa46 | |||
7a9c883a9b | |||
8d9005b7b7 | |||
a5f57a6b44 | |||
176e909c65 | |||
842dc88112 | |||
85dc35da7b | |||
aad3c29a9a | |||
8f0b8b5a27 | |||
8e130e6b73 | |||
3db2bc4f36 | |||
2788f3cd4e | |||
7ffdb3fff4 |
@ -5,7 +5,7 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
env:
|
env:
|
||||||
required: false
|
required: true
|
||||||
type: string
|
type: string
|
||||||
inputs:
|
inputs:
|
||||||
environment:
|
environment:
|
||||||
@ -52,7 +52,6 @@ jobs:
|
|||||||
args: ${{ inputs.composer-args }}
|
args: ${{ inputs.composer-args }}
|
||||||
|
|
||||||
- name: Create .env file from secret
|
- name: Create .env file from secret
|
||||||
if: ${{ secrets.env }}
|
|
||||||
run: echo "${{ secrets.env }}" > .env
|
run: echo "${{ secrets.env }}" > .env
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
|
93
.gitea/workflows/qore.yml
Normal file
93
.gitea/workflows/qore.yml
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
secrets:
|
||||||
|
ssh-private-key:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
env:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
frontend-env:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
inputs:
|
||||||
|
environment:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
image:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: git.qlic.nl/qlic/deploy:php8.3-node22
|
||||||
|
node-package-manager:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
frontend-directory:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
composer-args:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: --verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader --ignore-platform-reqs
|
||||||
|
username:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ${{ vars.REGISTRY_USERNAME }}
|
||||||
|
password:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ${{ vars.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
container:
|
||||||
|
image: ${{ inputs.image }}
|
||||||
|
credentials:
|
||||||
|
username: ${{ inputs.username }}
|
||||||
|
password: ${{ inputs.password }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
clean: false
|
||||||
|
|
||||||
|
- name: Setup composer
|
||||||
|
uses: https://git.qlic.nl/actions/setup-composer@v1
|
||||||
|
with:
|
||||||
|
args: ${{ inputs.composer-args }}
|
||||||
|
|
||||||
|
- name: Create frontend .env file from secret
|
||||||
|
run: echo "${{ secrets.frontend-env }}" > frontend/.env
|
||||||
|
|
||||||
|
- name: Create .env file from secret
|
||||||
|
run: echo "${{ secrets.env }}" > .env
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
if: ${{ inputs.node-package-manager }}
|
||||||
|
run: |
|
||||||
|
if [ -n "${{ inputs.frontend-directory }}" ]; then
|
||||||
|
cd "${{ inputs.frontend-directory }}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${{ inputs.node-package-manager }}" = "npm" ]; then
|
||||||
|
${{ inputs.node-package-manager }} ci
|
||||||
|
elif [ "${{ inputs.node-package-manager }}" = "pnpm" ] || [ "${{ inputs.node-package-manager }}" = "yarn" ]; then
|
||||||
|
${{ inputs.node-package-manager }} install --frozen-lockfile
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${{ inputs.node-package-manager }}" != "none" ] && [ -n "${{ inputs.node-package-manager }}" ]; then
|
||||||
|
${{ inputs.node-package-manager }} run build
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Set up SSH agent
|
||||||
|
uses: webfactory/ssh-agent@v0.5.3
|
||||||
|
with:
|
||||||
|
ssh-private-key: ${{ secrets.ssh-private-key }}
|
||||||
|
|
||||||
|
- name: Disable strict host key checking
|
||||||
|
run: |
|
||||||
|
echo "Host *" >> ~/.ssh/config
|
||||||
|
echo " StrictHostKeyChecking no" >> ~/.ssh/config
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
|
run: vendor/bin/dep deploy environment="${{ inputs.environment }}"
|
Loading…
x
Reference in New Issue
Block a user