diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 4b734f8..2096e51 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -9,10 +9,18 @@ jobs: runs-on: self-hosted steps: - name: Checkout - uses: actions/checkout@v3 + run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" + if [ -d "$GITHUB_WORKSPACE/.git" ]; then + git -C "$GITHUB_WORKSPACE" fetch --all + git -C "$GITHUB_WORKSPACE" reset --hard "$GITHUB_SHA" + else + git clone "http://192.168.5.171:3000/$GITHUB_REPOSITORY.git" "$GITHUB_WORKSPACE" + git -C "$GITHUB_WORKSPACE" checkout "$GITHUB_SHA" + fi - name: Build image - run: docker build -t 3d-pricing:latest . + run: docker build -t 3d-pricing:latest "$GITHUB_WORKSPACE" - name: Redeploy run: |