1
votes

I've been struggling with this project for a while now and I've scrapped everything to try and just get the basics down with Sapper/Svelte and GitHub Pages deployment as I need this to run as a GitHub App. I have gone through multiple tutorials and right now I've tried to match this example repo as close as possible but I'm getting an error on Build and Deploy.

The error I keep seeing when I look in the GitHub Actions tab is:

❌ Build and Deploy

Run JamesIves/github-pages-deploy-action@releases/v3

Checking configuration and starting deployment… ????

Deploying using Access Token… ????

Configuring git…

##[error]There was an error initializing the repository: The process '/usr/bin/git' failed with exit code 128 ❌

Deployment failed! ❌

Everything else passes. I'm new to Sapper/Svelte and somewhat new to GitHub Pages so forgive me if I'm missing something obvious.

EDIT:

My main.yml file looks similar to the following:

name: Build and Deploy
on:
  push:
    branches:
      - master
jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2
      with:
        persist-credentials: false

    - name: Use Node.js '12.x'
      uses: actions/setup-node@v1
      with:
        node-version: '12.x'
    - run: npm install
    - run: npm run export
    - name: Build and Deploy
      uses: JamesIves/github-pages-deploy-action@releases/v3
      with:
        ACCESS_TOKEN: ${{ secrets.<my secret that definitely exists on GitHub }}
        BRANCH: gh-pages
        FOLDER: __sapper__/export/<my repo>

This was copied from https://gavinr.com/svelte-sapper-github-pages-actions/

1
Could it possibly be related to your "secrets" values? seems like the git action is unable to perform the action with the credentials provided. Also have a look here on how to setup these credentials. github.com/marketplace/actions/github-pages-deployCraig Wayne
I've added the structure of my main.yml code in my question.brettwbyron
Thanks brett, just to confirm, have you completed this step? Create a GitHub Access Token by going to github.com/settings/tokens (scopes: repo access)Craig Wayne
After thinking about it. I had only given the token read access. I went back and changed that to full repo access and it worked! Thank you for shedding a light on that mistake for me!!brettwbyron

1 Answers

1
votes

Craig's comment pointed me in the right direction. The issue was with my access token's permissions. I needed to make sure I had full repo access in order for the app to build.