Files
aoc/.gitea/workflows/deploy.yml
T
2026-08-28 21:06:38 +02:00

38 lines
1.1 KiB
YAML

# https://docs.github.com/en/actions/reference/workflows-and-actions/variables
---
name: deploy
on:
push:
paths:
- '*.yml'
- '*.yaml'
env:
GIT_ASKPASS: ${{ vars.RUNNER_SCRIPT_DIR }}/askpass_helper.sh
GIT_TOKEN: ${{ secrets.TOKEN_SVC_CI }}
GIT_REPO: ${{ gitea.repository }}
DOCKER_STACK_NAME: aoc
jobs:
deploy:
runs-on: swarm-test
steps:
- name: get repo
working-directory: /swarm
if: ${{ contains( gitea.event.head_commit.message , '!clone' ) }}
run: |
git clone $GITHUB_SERVER_URL/$GIT_REPO $DOCKER_STACK_NAME
cd $DOCKER_STACK_NAME
git submodule update --init
- name: update repo
working-directory: /swarm/${{ env.DOCKER_STACK_NAME }}
run: git pull
- name: stop stack
run: docker stack rm $DOCKER_STACK_NAME
- name: start stack
working-directory: /swarm/${{ env.DOCKER_STACK_NAME }}
run: docker stack deploy -c docker-compose.yml $DOCKER_STACK_NAME
if: ${{ !contains( gitea.event.head_commit.message , '!clone' ) }}