Files
AntiCaptcha/.gitea/workflows/build.yml
T
admin 6500719689
Build and Deploy / deploy (push) Has been cancelled
Build and Deploy / build (push) Has been cancelled
ci: enable auto-deploy on main branch push, use docker compose v2
2026-07-17 00:07:09 +00:00

61 lines
1.4 KiB
YAML

name: Build and Deploy
on:
push:
branches:
- main
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Build frontend
working-directory: ./web
run: |
npm install
npm run build
- name: Setup Docker
uses: docker/setup-buildx-action@v3
- name: Login to Registry
uses: docker/login-action@v3
with:
registry: git.viaeon.com
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: git.viaeon.com/admin/anticaptcha:latest
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to server
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT || 22 }}
script: |
cd /opt/anticaptcha
docker compose pull
docker compose up -d