Files
MineSeeker/.gitea/workflows/deploy.yml
T
lang 8b428260d7
Deploy to Production / deploy (push) Successful in 27s
chg: pkg: new version release !skipChangelog
2026-07-27 19:30:53 +02:00

45 lines
1.2 KiB
YAML

name: Deploy to Production
on:
push:
tags:
- 'v*'
jobs:
deploy:
runs-on: splendid-bear
steps:
- name: Checkout tag
env:
GITEA_TOKEN: ${{ gitea.token }}
run: |
set -e
export HOME=/tmp
git config --global credential.helper '!f() { echo "username=oauth2"; echo "password=$GITEA_TOKEN"; }; f'
git config --global --add safe.directory "${{ vars.PROD_APP_DIR }}"
cd "${{ vars.PROD_APP_DIR }}"
git remote set-url origin "${{ gitea.server_url }}/${{ gitea.repository }}.git"
git fetch --tags --force
git checkout "${{ gitea.ref_name }}"
- name: Write .env
env:
PROD_ENV_FILE: ${{ secrets.PROD_ENV_FILE }}
run: |
printf '%s' "$PROD_ENV_FILE" > "${{ vars.PROD_APP_DIR }}/.env"
- name: Build image
run: |
cd "${{ vars.PROD_APP_DIR }}"
docker compose build
- name: Start services
env:
APP_VERSION: ${{ vars.APP_VERSION }}
run: |
cd "${{ vars.PROD_APP_DIR }}"
docker compose up -d minio
docker compose rm -sf minio_init
docker compose run --rm minio_init
docker compose up -d