diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 33b3cad..0b3adcf 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,6 +22,7 @@ jobs: VPS_SSH_KEY: ${{ secrets.VPS_SSH_KEY }} ENV_FILE: ${{ secrets.ENV_FILE }} REPO_URL: ${{ github.server_url }}/${{ github.repository }}.git + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # 1. Setup SSH Key mkdir -p ~/.ssh @@ -37,6 +38,9 @@ jobs: # Configure git safe directory git config --global --add safe.directory \$APP_DIR + # Configure git to use token for authentication + git config --global url.\"https://x-access-token:$GITHUB_TOKEN@github.com/\".insteadOf \"https://github.com/\" + # Clone or update repository if [ -d \"\$APP_DIR/.git\" ]; then echo 'Repository exists, pulling latest changes...'