JamesIves / github-pages-deploy-action

🚀 Automatically deploy your project to GitHub Pages using GitHub Actions. This action can be configured to push your production-ready code into any branch you'd like.
https://github.com/marketplace/actions/deploy-to-github-pages
MIT License
4.16k stars 357 forks source link

Deployment failed with Exit code 128 #1626

Open zbw182 opened 2 weeks ago

zbw182 commented 2 weeks ago

Describe the bug

Ran into this issue when updating our site and redeploying

Error: The deploy step encountered an error: There was an error creating the worktree: The process '/usr/bin/git' failed with exit code 128 ❌ ❌

Reproduction Steps

Merged in some changes, and the redeployment failed. We're most likely doing something silly here, but I'm not familiar enough with the how the deployment process works to see any obvious issues.

This line looks suspicious

fatal: 'master' is already used by worktree at '/home/runner/work/ota-analyzer/ota-analyzer'

Logs

Checking configuration and starting deployment… 🚦 Configuring SSH client… 🔑 Identity added: (stdin) (zhangkelvin@zhangkelvin-macbookpro.roam.corp.google.com) Deploying using SSH Deploy Key… 🔑 Configuring git… /usr/bin/git config user.name zhangxp1998 /usr/bin/git config user.email zhangxp1998@gmail.com /usr/bin/git remote rm origin /usr/bin/git remote add origin git@github.com:android/android.github.io Git configured… 🔧 Starting to commit changes… /usr/bin/git ls-remote --heads git@github.com:android/android.github.io refs/heads/master e6f43fbe6c548418679eb0fea070c40b96978949 refs/heads/master Creating worktree… /usr/bin/git fetch --no-recurse-submodules --depth=1 origin master From github.com:android/android.github.io

::set-output name=deployment-status::failed

Workflow

name: Node.js CI

on: push: branches: [ master ] pull_request: branches: [ master ]

jobs: build:

runs-on: ubuntu-latest

strategy:
  matrix:
    node-version: [16.x]
    # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
  uses: actions/setup-node@v2
  with:
    node-version: ${{ matrix.node-version }}
    cache: 'npm'
- run: npm ci --force
- run: NODE_ENV=production npm run build --if-present
- name: Deploy to GitHub Pages
  uses: JamesIves/github-pages-deploy-action@4.1.5
  with:
    branch: 'master'
    folder: 'dist'
    ssh-key: '${{ secrets.SSH_KEY }}'
    clean: false
    repository-name: 'android/android.github.io'
    target-folder: 'analyseOTA'

Additional Comments

JamesIves commented 2 weeks ago

Please upgrade to 4.6.1 as this issue was resolved in that version - https://github.com/JamesIves/github-pages-deploy-action/releases/tag/v4.6.1

runs-on: ubuntu-latest

strategy:
  matrix:
    node-version: [16.x]
    # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
  uses: actions/setup-node@v2
  with:
    node-version: ${{ matrix.node-version }}
    cache: 'npm'
- run: npm ci --force
- run: NODE_ENV=production npm run build --if-present
- name: Deploy to GitHub Pages
  uses: JamesIves/github-pages-deploy-action@4.6.1
  with:
    branch: 'master'
    folder: 'dist'
    ssh-key: '${{ secrets.SSH_KEY }}'
    clean: false
    repository-name: 'android/android.github.io'
    target-folder: 'analyseOTA'
zbw182 commented 2 weeks ago

adding the above to .github/workflows/github-actions-demo.yml results in

Error: Unable to resolve action `jamesives/github-pages-deploy-action@4.6.1`, unable to find version `4.6.1`

Any idea what's going on here : )

SergeyFi commented 1 week ago

You need to add the letter "v" to version: JamesIves/github-pages-deploy-action@v4.6.1 And also, сheck that "Read and write permissions" are enabled in "Settings -> Actions -> General -> Workflow permissions".

JamesIves commented 1 week ago

Thanks @SergeyFi - my bad on the typo

For context that version corresponds to a tag, you can find the full list of available ones here: https://github.com/JamesIves/github-pages-deploy-action/tags