From 8a9bdc744a7b7810a362a7494e932ae80fc8ade2 Mon Sep 17 00:00:00 2001 From: Jamie Schouten Date: Sat, 14 Sep 2024 16:54:41 +0000 Subject: [PATCH] Add .gitea/workflows/deploy.yml --- .gitea/workflows/deploy.yml | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..58a0e8c --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,49 @@ +on: + workflow_call: + secrets: + ssh-private-key: + required: true + type: string + env: + required: true + type: string + inputs: + image: + required: false + type: string + default: git.qlic.nl/qlic/deploy:php8.3-node22 + 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: git.qlic.nl/qlic/deploy:php8.3-node22 + credentials: + username: ${{ inputs.username }} + password: ${{ input.password }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + - uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 + with: + ssh-private-key: ${{ secrets.ssh-private-key }} + - name: Setup composer + uses: https://git.qlic.nl/actions/setup-composer@main + with: + args: --verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader --ignore-platform-reqs + - name: Create .env file from secret + run: echo "${{ secrets.env }}" > .env + - name: Disable strict host key checking + run: | + echo "Host *" >> ~/.ssh/config + echo " StrictHostKeyChecking no" >> ~/.ssh/config + - name: Deploy + run: vendor/bin/dep deploy environment=production \ No newline at end of file