This commit is contained in:
parent
618f67a48a
commit
4846f43f98
19
.gitea/deploy.sh
Executable file
19
.gitea/deploy.sh
Executable 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
|
22
.gitea/workflows/deploy.yml
Normal file
22
.gitea/workflows/deploy.yml
Normal 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
|
Loading…
Reference in New Issue
Block a user