fix: replace actions/checkout with native git — runner has no node
Some checks failed
Deploy / deploy (push) Has been cancelled
Some checks failed
Deploy / deploy (push) Has been cancelled
The self-hosted runner (gitea-act-runner-custom) lost node after image rebuild. Replace actions/checkout@v4 with plain git clone/reset. Also adds a guard to auto-rebuild the runner image if node is missing.
This commit is contained in:
17
.github/workflows/deploy.yml
vendored
17
.github/workflows/deploy.yml
vendored
@@ -8,8 +8,21 @@ jobs:
|
||||
deploy:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Rebuild runner image if needed
|
||||
run: |
|
||||
if ! docker run --rm gitea-act-runner-custom:latest node --version > /dev/null 2>&1; then
|
||||
docker build -t gitea-act-runner-custom:latest -f /home/deployer/gitea-runner.Dockerfile /home/deployer/
|
||||
fi
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
run: |
|
||||
if [ ! -d /workspace/darkcodex/api-ubigeo/.git ]; then
|
||||
git clone https://948ee86882f8d9ca46eb94750addfccdace443a6@git.darkcodex.dev/darkcodex/api-ubigeo.git \
|
||||
/workspace/darkcodex/api-ubigeo
|
||||
fi
|
||||
cd /workspace/darkcodex/api-ubigeo
|
||||
git fetch origin main
|
||||
git reset --hard origin/main
|
||||
|
||||
- name: Sync source
|
||||
run: |
|
||||
@@ -18,7 +31,7 @@ jobs:
|
||||
--exclude='node_modules' \
|
||||
--exclude='dist' \
|
||||
--exclude='.env' \
|
||||
. /home/deployer/api-ubigeo/
|
||||
/workspace/darkcodex/api-ubigeo/ /home/deployer/api-ubigeo/
|
||||
|
||||
- name: Build & deploy
|
||||
run: bash /home/deployer/deploy-ubigeo.sh
|
||||
|
||||
Reference in New Issue
Block a user