-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Github Actions deployment error #2846
Comments
@artemkovalyov could you please look at it? |
I think the error is originating from missing
|
I will make a pr for check job and checking if a lock file is present before using |
Given that yarn was used and created |
|
@pdimens npm doesn't recognize |
Hi.. I am facing the same issue and cannot find package-lock.json file when I install docusaurus via |
Hey, Using NPM ?If you don't have a package-lock.json file, do you use npm locally? If yes, have you run Since npm5, all npm installs normally create a package-lock.json file. Have you committed this lockfile? you should. Using Yarn ?Then you have a So you should replace all NPM commands by yarn equivalent
so when you see:
You can replace by:
Don't forget to install yarn in the Github CI first: https://codyogden.blog/yarn-with-github-actions-ci-cd/ |
Following @slorber suggestion, I modified the GitHub Actions workflow to: name: documentation
on:
pull_request:
branches: [documentation]
push:
branches: [documentation]
jobs:
checks:
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: npm install -g yarn
- name: Deploy
run: |
yarn install --frozen-lockfile
yarn build
gh-release:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Add key to allow access to repository
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
echo "${{ secrets.GH_PAGES_DEPLOY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
cat <<EOT >> ~/.ssh/config
Host github.com
HostName github.com
IdentityFile ~/.ssh/id_rsa
EOT
- name: Release to GitHub Pages
env:
USE_SSH: true
GIT_USER: git
run: |
git config --global user.email "actions@gihub.com"
git config --global user.name "gh-actions"
npm ci
npx docusaurus deploy and the result now seems to be an authentication error. I am under the impression that I followed the documentation about this process correctly, but now I'm unsure.
|
That does not seem related to docusaurus, you should refer to Github Actions doc for that imho. Maybe you have a problem with your GH_PAGES_DEPLOY, but I don't know, we are not Github CI experts here :) Deploying to Github Pages looks really complicated to me. @yangshun @JoelMarcey current docs seems to recommend Github Pages (at least it's the first thing users see). What about recommending something else, that is also free, and does not require complex CI setup? Github pages was nice a few years ago, as it was the only free static hosting provider, but since then, the market has changed a lot... |
It wouldn't work if u have passcode on ssh key |
@anshulrgoyal I don't know if I do (pretty new to this) and don't recall setting it up in such a manner. I may have to retry the instructions on the docusaurus site. |
I have forked your repo and setted up GitHub action there using two different methods. U can try them. One of then doesn't require any config |
@pdimens this should work out of box https://github.com/anshulrgoyal/PopGen.jl/blob/documentation/.github/workflows/test.yml |
@anshulrgoyal thank you! I still seem to have deployment/authentication issues though, but it's probably something incorrectly configured on my part?
|
@anshulrgoyal to follow up, I tried to see if it would make a difference to set up an SSH key for |
This action works just fine without creating SSH key, using default |
This an example github action that I am using to deploy to gh pages with name: deploy
on:
pull_request:
branches: [master]
push:
branches: [master]
jobs:
checks:
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Test Build
run: |
if [ -e yarn.lock ]; then
yarn install --frozen-lockfile
elif [ -e package-lock.json ]; then
npm ci
else
npm i
fi
npm run build
gh-release:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Build
run: |
if [ -e yarn.lock ]; then
yarn install --frozen-lockfile
elif [ -e package-lock.json ]; then
npm ci
else
npm i
fi
npm run build
- name: Release to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build |
very good |
When I try to execute the code on CI pipeline using Github Actions Here is yml file on: Manual Button Click from Github UIworkflow_dispatch: Pushing commit to the master branchpush:
schedule:
jobs: |
🐛 Bug Report
(A clear and concise description of what the bug is)
Following the guidelines of GitHub Actions deployment here: https://v2.docusaurus.io/docs/deployment/#deploy
The actions fail to build and deploy the site with this error:
To Reproduce
documentation.yml
from https://v2.docusaurus.io/docs/deployment/#deploy to file.github/workflows/documentation.yml
indocumentation
branch of repositoryExpected behavior
successfully build the site and deploy to branch gh-pages
Actual Behavior
The actions fail to build and deploy the site with this error:
Your Environment
Reproducible Demo
https://github.com/pdimens/PopGen.jl/tree/documentation/.github/workflows
The text was updated successfully, but these errors were encountered: