Skip to content
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 action deploy failed, instructed by the guildance #3792

Closed
4 tasks done
TheoppoFish opened this issue Apr 16, 2024 · 1 comment
Closed
4 tasks done

Github action deploy failed, instructed by the guildance #3792

TheoppoFish opened this issue Apr 16, 2024 · 1 comment
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@TheoppoFish
Copy link

Describe the bug

Hi team,

I have tried with a self-hosted gha runner.

the gha workflow is copy/paste from the guidance, here

Unfortunately, I failed at the Upload artifact stage
image

Here is my workflow:

name: Deploy VitePress site to git pages

on:
  push:
    branches: [main]

permissions:
  contents: read
  pages: write
  id-token: write

concurrency:
  group: pages
  cancel-in-progress: false

jobs:
  build:
    runs-on: self-hosted
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: 18
          cache: npm
      - name: Setup Pages
        uses: actions/configure-pages@v4
      - name: Install dependencies
        run: npm install
      - name: Build with VitePress
        env:
          NODE_OPTIONS: "--max_old_space_size=4096"
        run: npm run docs:build
      - name: Upload artifact
        uses: actions/upload-pages-artifact@v3
        with:
          path: .vitepress/dist

  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    needs: build
    runs-on: self-hosted
    name: Deploy
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v4

Reproduction

Re-runed multiple times, but still failed

Expected behavior

should upload artefacts?

System Info

deploying on git page

using self-host runner

Additional context

No response

Validations

@TheoppoFish TheoppoFish added the bug: pending triage Maybe a bug, waiting for confirmation label Apr 16, 2024
@brc-dd
Copy link
Member

brc-dd commented Apr 27, 2024

I have no idea. Please check with GitHub support on how to upload artifacts with third party / self hosted runners. You can create a separate branch and use branch-based github pages deployment instead of using actions to upload pages artifacts.

You can probably use something like this https://github.com/peaceiris/actions-gh-pages for branch based deploys. (the publish_dir should be configured to docs/.vitepress/dist. You can remove upload artifact step.

@brc-dd brc-dd closed this as not planned Won't fix, can't repro, duplicate, stale Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

2 participants