Files
a301_server/.gitea/workflows/deploy.yml
tolelom 9c27edf4fb
Some checks failed
Server CI/CD / lint-and-build (push) Failing after 53s
Server CI/CD / deploy (push) Has been skipped
ci: 테스트 실행 추가 + git clone 토큰 로그 노출 방지
- lint-and-build 단계에 go test ./... 추가
- deploy 단계 git clone에 set +x / --quiet / 2>/dev/null 적용

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 20:09:39 +09:00

55 lines
1.5 KiB
YAML

name: Server CI/CD
on:
push:
branches:
- main
jobs:
lint-and-build:
runs-on: ubuntu-latest
steps:
- name: 코드 체크아웃
uses: actions/checkout@v4
- name: Go 설치
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: go vet 검증
run: go vet ./...
- name: 테스트 실행
run: go test ./... -count=1
- name: 빌드 검증
run: go build -o /dev/null .
deploy:
runs-on: ubuntu-latest
needs: lint-and-build
steps:
- name: 서버에 배포
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: 22
script: |
set -e
export PATH=$PATH:/usr/local/bin:/opt/homebrew/bin:$HOME/.docker/bin
cd /tmp
rm -rf a301-build
mkdir a301-build && cd a301-build
# Suppress token from logs
set +x
git clone --quiet https://tolelom:${{ secrets.GIT_TOKEN }}@git.tolelom.xyz/A301/a301_server.git a301_server 2>/dev/null
set -x
git clone --quiet https://github.com/tolelom/tolchain.git tolchain
docker build --no-cache -t a301-server:latest -f a301_server/Dockerfile .
cd ~/server
docker compose up -d --no-deps --force-recreate a301-server
rm -rf /tmp/a301-build