Add .gitea/workflows/deploy.yml

This commit is contained in:
Johan Rooijakkers 2025-02-07 14:33:20 +00:00
commit 5d56fbbfc5

View File

@ -0,0 +1,52 @@
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/kamal:latest
environment:
required: true
type: string
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
- uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Create .env file from secret
run: echo "${{ secrets.ENV }}" > .kamal/secrets
- name: Deploy
run: kamal deploy -d ${{ inputs.environment }}
- 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 }}"