Fix: Gitea 워크플로우에서 GitHub Action 의존 제거
actions/checkout, actions/setup-go, appleboy/ssh-action을 직접 실행 방식으로 대체. Gitea runner github.com clone 차단 문제 해결. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -10,48 +10,48 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: 코드 체크아웃
|
- name: 코드 체크아웃
|
||||||
uses: actions/checkout@v4
|
run: |
|
||||||
|
git config --global --add safe.directory "$(pwd)"
|
||||||
|
git init
|
||||||
|
git remote add origin $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git
|
||||||
|
git fetch --depth=1 origin $GITHUB_SHA
|
||||||
|
git checkout $GITHUB_SHA
|
||||||
|
|
||||||
- name: tolchain 의존성 클론
|
- name: tolchain 의존성 클론
|
||||||
run: git clone --depth 1 https://github.com/tolelom/tolchain.git ../tolchain
|
run: git clone --depth 1 https://github.com/tolelom/tolchain.git ../tolchain
|
||||||
|
|
||||||
- name: Go 설치
|
- name: Go 설치
|
||||||
uses: actions/setup-go@v5
|
run: |
|
||||||
with:
|
curl -fsSL https://go.dev/dl/go1.25.5.linux-arm64.tar.gz -o /tmp/go.tar.gz
|
||||||
go-version: '1.25'
|
rm -rf /usr/local/go && tar -C /usr/local -xzf /tmp/go.tar.gz
|
||||||
|
export PATH=$PATH:/usr/local/go/bin
|
||||||
|
go version
|
||||||
|
|
||||||
- name: go vet 검증
|
- name: go vet 검증
|
||||||
run: go vet ./...
|
run: |
|
||||||
|
export PATH=$PATH:/usr/local/go/bin
|
||||||
|
go vet ./...
|
||||||
|
|
||||||
- name: 테스트 실행
|
- name: 테스트 실행
|
||||||
run: go test ./... -count=1
|
run: |
|
||||||
|
export PATH=$PATH:/usr/local/go/bin
|
||||||
|
go test ./... -count=1
|
||||||
|
|
||||||
- name: 빌드 검증
|
- name: 빌드 검증
|
||||||
run: go build -o /dev/null .
|
run: |
|
||||||
|
export PATH=$PATH:/usr/local/go/bin
|
||||||
|
go build -o /dev/null .
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: lint-and-build
|
needs: lint-and-build
|
||||||
steps:
|
steps:
|
||||||
- name: 서버에 배포
|
- name: 서버에 배포
|
||||||
uses: appleboy/ssh-action@v1
|
run: |
|
||||||
with:
|
mkdir -p ~/.ssh
|
||||||
host: ${{ secrets.SERVER_HOST }}
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/deploy_key
|
||||||
username: ${{ secrets.SERVER_USER }}
|
chmod 600 ~/.ssh/deploy_key
|
||||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
ssh -o StrictHostKeyChecking=no -i ~/.ssh/deploy_key \
|
||||||
port: 22
|
${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }} \
|
||||||
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 && git clone --quiet https://tolelom:${{ secrets.GIT_TOKEN }}@git.tolelom.xyz/A301/a301_server.git a301_server && 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'
|
||||||
set -e
|
rm -f ~/.ssh/deploy_key
|
||||||
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
|
|
||||||
|
|||||||
Reference in New Issue
Block a user