add frontend build
This commit is contained in:
parent
e81c18b8a9
commit
369317ea66
@ -12,6 +12,16 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
default: git.qlic.nl/qlic/deploy:php8.3-node22
|
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:
|
username:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
@ -25,25 +35,49 @@ jobs:
|
|||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
container:
|
container:
|
||||||
image: git.qlic.nl/qlic/deploy:php8.3-node22
|
image: ${{ inputs.image }}
|
||||||
credentials:
|
credentials:
|
||||||
username: ${{ inputs.username }}
|
username: ${{ inputs.username }}
|
||||||
password: ${{ inputs.password }}
|
password: ${{ inputs.password }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387
|
|
||||||
with:
|
|
||||||
ssh-private-key: ${{ secrets.ssh-private-key }}
|
|
||||||
- name: Setup composer
|
- name: Setup composer
|
||||||
uses: https://git.qlic.nl/actions/setup-composer@main
|
uses: https://git.qlic.nl/actions/setup-composer@main
|
||||||
with:
|
with:
|
||||||
args: --verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader --ignore-platform-reqs
|
args: ${{ inputs.composer-args }}
|
||||||
|
|
||||||
- name: Create .env file from secret
|
- name: Create .env file from secret
|
||||||
run: echo "${{ secrets.env }}" > .env
|
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
|
- name: Disable strict host key checking
|
||||||
run: |
|
run: |
|
||||||
echo "Host *" >> ~/.ssh/config
|
echo "Host *" >> ~/.ssh/config
|
||||||
echo " StrictHostKeyChecking no" >> ~/.ssh/config
|
echo " StrictHostKeyChecking no" >> ~/.ssh/config
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: vendor/bin/dep deploy environment=production
|
run: vendor/bin/dep deploy environment=production
|
Loading…
x
Reference in New Issue
Block a user