Comments (9)
Aha, I think I know the issue here. This is because you have two jobs named build
and deploy
. You're building the site to deploy in the build
job, but the deploy
job is almost as-if it's a fresh start and doesn't have access to the project. If you need to build your site using a different operating system you can pass the built directory from one to another using artifacts (see docs here), but if not you can just combine the two to fix this.
name: Publish
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Set email
run: git config --global user.email "${{ secrets.adminemail }}"
- name: Set username
run: git config --global user.name "${{ secrets.adminname }}"
- name: NPM install command
run: cd website && npm install
- name: check package.json
run: cat package.json
- name: Run build command
run: npm run build
- name: Checkout
uses: actions/checkout@v1
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_BRANCH: master
BRANCH: gh-pages
FOLDER: website/build
Additionally if you see the site deploy correctly but you don't see your changes you may need to use the ACCESS_TOKEN
key instead: https://github.com/JamesIves/github-pages-deploy-action#configuration-
from github-pages-deploy-action.
I was just about to post about that, haha
That was exactly the answer! thanks for all your help!
from github-pages-deploy-action.
Woah, thanks for the fast response!
I still get a similar issue, this weird documentation//
rsync: change_dir "/home/runner/work/documentation/documentation//website/build" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196) [sender=3.1.2]
The deployment encountered an error. ❌
##[error]The process 'rsync' failed with exit code 23
I'm wondering why it inserts that unnamed directory and then looks for the website/build
directory.
from github-pages-deploy-action.
I cloned down your repository to test this, I think the issue is that your build script in your website
directory doesn't actually build into the root directory, it goes into ../documentation/website/build
.
In order to fix this can you try changing the following line to website/build
? The folder is based on the root of the repository.
https://github.com/excelerondesign/documentation/blob/master/.github/workflows/main.yml#L36
Let me know if that helps!
from github-pages-deploy-action.
That's because actions/checkout
checks out the repo into its own named directory, so that should be correct. Something seems amiss still.
Can you add the following in your build step and run it again? I want to make sure that the build
directory is getting correctly generated. Once it's done running can you link me the log?
- name: Run build command
run: npm run build && ls
from github-pages-deploy-action.
Hmmm, that didn't do it.
The updated .yml
is here
name: Publish
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Set email
run: git config --global user.email "${{ secrets.adminemail }}"
- name: Set username
run: git config --global user.name "${{ secrets.adminname }}"
- name: npm install command
run: cd website && npm install
- name: Run build command
run: cd website && npm run build
- name: Checkout
uses: actions/checkout@v1
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_BRANCH: master
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: website/build # The folder the action should deploy.
I'm getting the same error with the documentation//
I don't know if this changes anything, but there is a could of lines at the end of the error message, maybe this sheds some light? Like the node run error?
rsync -q -av --progress website/build/. gh-action-temp-deployment-folder --exclude .git --exclude .github
rsync: change_dir "/home/runner/work/documentation/documentation//website/build" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196) [sender=3.1.2]
The deployment encountered an error. ❌
##[error]The process 'rsync' failed with exit code 23
Completed Deployment ✅
##[error]Node run failed with exit code 1
from github-pages-deploy-action.
Re: adding the ls
to the build command, it is building the directory correctly
> @ build /home/runner/work/documentation/documentation/website
> docusaurus-build
generate.js triggered...
sitemap.js triggered...
Site built successfully. Generated files in 'build' folder.
README.md
build
core
i18n
node_modules
package-lock.json
package.json
pages
sidebars.json
siteConfig.js
static
from github-pages-deploy-action.
Ah sorry, don't include the checkout step before the deploy step. Otherwise you're going to override your changes. Try this:
name: Publish
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Set email
run: git config --global user.email "${{ secrets.adminemail }}"
- name: Set username
run: git config --global user.name "${{ secrets.adminname }}"
- name: npm install command
run: cd website && npm install
- name: Run build command
run: cd website && npm run build
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_BRANCH: master
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: website/build # The folder the action should deploy.
I don't think documentation//
should be an issue.
from github-pages-deploy-action.
Just tested this again in my cloned repo. If you want the documentation files to deploy to the root you'll need to change the config so FOLDER
points to website/build/documentation
, or change your build script so it builds directly into the build
folder.
https://github.com/JamesIves/documentation/blob/master/.github/workflows/main.yml
This will result in this: https://github.com/JamesIves/documentation/tree/gh-pages
Hope that helps!
from github-pages-deploy-action.
Related Issues (20)
- Commit fails with "process '/usr/bin/git' failed with exit code 128" HOT 3
- Error: You must provide the action with a folder to deploy.
- This project is now deprecated
- GitHub Actions `set-output` command is deprecated and will be disabled soon HOT 2
- Reporting a vulnerability HOT 1
- `token` not being used sometimes HOT 2
- fatal: A branch named 'main' already exists. HOT 7
- Pushed file asyncapi.html gets renamed to index.html HOT 3
- Can't push folder in project HOT 2
- remote: Permission denied to github-actions[bot] HOT 1
- I have this problem, everyone can help me ? This is for a react project HOT 1
- Git config not found for centos:7 HOT 2
- Action succeeds even when push fails HOT 1
- GitHub Pages re-building with Jekyll despite .nojekyll present HOT 1
- A file is missing or not transferred to github pages HOT 5
- The directory you're trying to deploy named /home/runner/work/RivioxTweaks/RivioxTweaks/dist doesn't exist. HOT 1
- There is nothing to commit. Exiting early… HOT 1
- The deploy step encountered an error: The process '/usr/bin/git' failed with exit code 1 ❌ HOT 3
- fatal: Authentication failed HOT 1
- Error: The deploy step encountered an error: The process '/usr/bin/git' failed with exit code 128 ❌ HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from github-pages-deploy-action.