Added deploy pipeline
All checks were successful
Test and build / build (push) Successful in 3s

This commit is contained in:
Lilleman auf Larv 2024-02-04 04:29:40 +01:00
parent 618f67a48a
commit 4846f43f98
2 changed files with 41 additions and 0 deletions

19
.gitea/deploy.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
curl \
--fail-with-body \
-H "Authorization: ${RUNNER_API_KEY}" \
-XPOST 192.168.1.186 \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary @- <<EOF
{
"commands": [
"git clone --single-branch --branch ${GITHUB_REF_NAME} --depth 1 ssh://git@gitea.larvit.se:21022/pwrpln/auth-api.git",
"cd auth-api",
"echo \"${DOCKER_PASSWORD}\" | docker login gitea.larvit.se --username ${DOCKER_USERNAME} --password-stdin",
"docker pull gitea.larvit.se/pwrpln/auth-api:main",
"docker tag gitea.larvit.se/pwrpln/auth-api:main gitea.larvit.se/pwrpln/auth-api:${GITHUB_REF_NAME}",
"docker push gitea.larvit.se/pwrpln/auth-api:${GITHUB_REF_NAME}"
]
}
EOF

View File

@ -0,0 +1,22 @@
name: Test and build
run-name: ${{ gitea.actor }} testing and building
on:
push:
tags:
- '**'
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ vars.DOCKER_USERNAME }}
RUNNER_API_KEY: ${{ secrets.RUNNER_API_KEY }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.gitea/deploy.sh
sparse-checkout-cone-mode: false
- run: .gitea/deploy.sh