From 5d56fbbfc5c61a6418f078de6b87bddc7208cbb5 Mon Sep 17 00:00:00 2001 From: johan Date: Fri, 7 Feb 2025 14:33:20 +0000 Subject: [PATCH] Add .gitea/workflows/deploy.yml --- .gitea/workflows/deploy.yml | 52 +++++++++++++++++++++++++++++++++++++ 1 file changed, 52 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..3907a39 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -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 }}"