Closed Regenhardt closed 5 months ago
Who has access to the repo settings to set the deploy keys and check if pages deployments works in the other repo?
@Regenhardt I've added a ssh pub/priv key.
@Regenhardt @FroggieFrog I don't see that it worked.
It didn't do the deployment, stating no auth token. @seriouz please make sure the deploy key in the secrets it called DOCS_DEPLOY_KEY
In the input dump isn't even a placeholder for the deploy key, that either means there is no deploy key or that even the input is omitted from the dump.
The authMethod should have been dumped as DeployKey
in the first line of the input dump. The input variable in the action's code is DeployKey
, I assume that directly maps to the deploy_key
variable in the yml file.
I've added te DOCS_DEPLOY_KEY secret *and re-run the actions: https://github.com/bagetter/BaGetter/actions/runs/7697079955
Turns out it missed the docs/ prefix, gimme a moment.
There you go https://github.com/bagetter/BaGetter/pull/49
Still cp: no such file or directory: /home/runner/work/BaGetter/BaGetter/build/.*
, what am I missing?
[INFO] PublishDir: ./build
seems like it didn't use the newest workflow definition. I'll clear the only cache i could find and re-run the deployment.
Nope, it ran on the older commit again. Probably didn't work because docs/ wasn't changed. Guess I'll just add the workflows dir to the trigger paths.
Did you see the config of the docusaurus? The last part is quite different with yarn deploy
.github/workflows/deploy.yml
name: Deploy to GitHub Pages
on:
pull_request:
branches: [main]
push:
branches: [main]
permissions:
contents: write
jobs:
test-deploy:
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Test build website
run: yarn build
deploy:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
- uses: webfactory/ssh-agent@v0.5.0
with:
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
- name: Deploy to GitHub Pages
env:
USE_SSH: true
run: |
git config --global user.email "actions@github.com"
git config --global user.name "gh-actions"
yarn install --frozen-lockfile
yarn deploy
I don't see where the other repo is passed though, how does it know what repo to deploy to?
Also I added the yml file itself as trigger: https://github.com/bagetter/BaGetter/pull/50
It worked🎉 https://bagetter.github.io
Unless of course the gh-pages
branch is still set as deployment branch in the other repo, then that link would be no real proof lol.
I don't see where the other repo is passed though, how does it know what repo to deploy to?
Where the yarn deploy
knows where to deploy; It reads it from this config https://github.com/bagetter/BaGetter/blob/main/docs/docusaurus.config.ts
Turns out it's not too bad when I still have copilot to explain it to me. To work, this should only need a public/private key pair to be added to this and the website repo in order to give the action access to push there, and maybe a setting in the docs repo to tell Github to use the main branch as pages source, which I don't have access to.
I do have to admit I haven't tested it, as I'm not entirely sure how. Do I...rebuild the whole setup with two repos in a fresh namespace and copy everything over? I did run it through copilot so I'm fairly certain it works.
Edit: For the content, I literally just copied everything but the github config from the other repo into docs/ here.