Giter VIP home page Giter VIP logo

Comments (9)

JamesIves avatar JamesIves commented on May 17, 2024 2

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.

gingerchew avatar gingerchew commented on May 17, 2024 2

I was just about to post about that, haha
That was exactly the answer! thanks for all your help!

from github-pages-deploy-action.

gingerchew avatar gingerchew commented on May 17, 2024 1

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.

JamesIves avatar JamesIves commented on May 17, 2024

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.

JamesIves avatar JamesIves commented on May 17, 2024

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.

gingerchew avatar gingerchew commented on May 17, 2024

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.

gingerchew avatar gingerchew commented on May 17, 2024

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.

JamesIves avatar JamesIves commented on May 17, 2024

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.

JamesIves avatar JamesIves commented on May 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.