diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 72a35f7..4c83fb7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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