basic qore setup
This commit is contained in:
parent
bfc56002c4
commit
7ffdb3fff4
105
.gitea/workflows/qore.yml
Normal file
105
.gitea/workflows/qore.yml
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
- name: Determine frontend ref
|
||||||
|
- id: get-version
|
||||||
|
run: |
|
||||||
|
echo "version=$(grep -A 1 'qore/system' composer.lock | awk -F'" '/version/ {print $4}')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: qore/qore-frontend
|
||||||
|
ref: ${{ steps.get-version.outputs.version }}
|
||||||
|
ssh-key: ${{ vars.QORE_FRONTEND_DEPLOY_TOKEN }}
|
||||||
|
path: frontend/src
|
||||||
|
|
||||||
|
- name: Create frontend .env file from secret
|
||||||
|
run: echo "${{ secrets.frontend-env }}" > frontend/.env
|
||||||
|
|
||||||
|
- name: Setup composer
|
||||||
|
uses: https://git.qlic.nl/actions/setup-composer@v1
|
||||||
|
with:
|
||||||
|
args: ${{ inputs.composer-args }}
|
||||||
|
|
||||||
|
- 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