Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
ea4f3494d3 | |||
084da6f4f2 | |||
ddefd7c716 | |||
ae689fb7c6 |
@ -5,7 +5,7 @@ on:
|
||||
required: true
|
||||
type: string
|
||||
env:
|
||||
required: true
|
||||
required: false
|
||||
type: string
|
||||
inputs:
|
||||
environment:
|
||||
@ -52,6 +52,7 @@ jobs:
|
||||
args: ${{ inputs.composer-args }}
|
||||
|
||||
- name: Create .env file from secret
|
||||
if: ${{ secrets.env }}
|
||||
run: echo "${{ secrets.env }}" > .env
|
||||
|
||||
- name: Build
|
||||
|
@ -1,93 +0,0 @@
|
||||
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