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/
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.