hackforla / hackforla/admin-new-project-provisioning

Fix docs deployment

Open
#3 1 comment 0 reactions 1 assignee Claimed by @fyliu View on GitHub
bug
Dominant language
No language data
Stars
1
Forks
1
PR merge metrics
No merged PRs in 30d

Description

### Overview

We need to fix the docs deployment issue in new projects, so that it is working from the start.

### Action Items

- [x] fix ci.yml where it outputs a permissions error
- [ ] Document the options when creating the new repo so that the docs deployment works

### Resources/Instructions

Existing template mkdocs workflow
- it runs the workflow after the new project is created, but fails on a permissions error
```text
INFO - Copying '/home/runner/work/test-new-project5/test-new-project5/site' to 'gh-pages' branch and pushing to GitHub.
remote: Permission to fyliu/test-new-project5.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/fyliu/test-new-project5/': The requested URL returned error: 403
```
- it has to do with what workflows are allowed to do
- ~~to solve this~~: [this does not work. The setting doesn't carry over to the new repo, and the permissions is too broad. We should limit it to just the workflows that need it]
- go to Setting, Actions->General, Workflow permissions->Read and write permissions
- Save
- [new] to solve this:
- add this to ci.yml in `deploy:` before `steps:`
```
permissions:
contents: write
```
- rerun the workflow in the Actions tab and it will build the documentation but not expose it to gh-pages
- to solve this:
- go to Settings, Pages, Build and deployment->Source->Deploy from a branch, Branch->gh-pages
- now the mkdocs ci.yml workflow should work as intended

When creating a new repo from template
- be sure to “include all branches” so it comes with gh-pages branch
- make it public so that it can serve gh pages

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.