diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 2257db0..68b401b 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -13,7 +13,15 @@ jobs: install: runs-on: [self-hosted, rent-deploy] steps: - - uses: actions/checkout@v4 + - name: Checkout code + run: | + git clone --depth 1 --branch ${GITHUB_REF#refs/heads/} ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git . + git checkout ${GITHUB_SHA} + + - name: Setup Node.js + run: | + curl -fsSL https://deb.nodesource.com/setup_18.x | bash - + apt-get install -y nodejs - name: Install dependencies run: | @@ -25,7 +33,10 @@ jobs: runs-on: [self-hosted, rent-deploy] needs: install steps: - - uses: actions/checkout@v4 + - name: Checkout code + run: | + git clone --depth 1 --branch ${GITHUB_REF#refs/heads/} ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git . + git checkout ${GITHUB_SHA} - name: Build shared packages run: | @@ -52,7 +63,10 @@ jobs: needs: build if: github.ref == 'refs/heads/prod' steps: - - uses: actions/checkout@v4 + - name: Checkout code + run: | + git clone --depth 1 --branch ${GITHUB_REF#refs/heads/} ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git . + git checkout ${GITHUB_SHA} - name: Deploy to production run: | @@ -74,7 +88,10 @@ jobs: needs: build if: github.ref == 'refs/heads/test' steps: - - uses: actions/checkout@v4 + - name: Checkout code + run: | + git clone --depth 1 --branch ${GITHUB_REF#refs/heads/} ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git . + git checkout ${GITHUB_SHA} - name: Deploy to test run: |