Closed daironpf closed 7 months ago
i make some changes in the code and now the error is this:
This is the code of my action
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ['main']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: 'frontend'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: 20
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: /dist
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
source: dist
Try changing the path from /dist
to ./dist
. Removing the slash altogether could work too.
Try changing the path from
/dist
to./dist
. Removing the slash altogether could work too.
change:
change: uses: actions/upload-artifact@v4 with: name: dist path: dist Result:
oh never mind did not see:
working-directory: 'frontend'
Your artifacts' location is ./frontend/dist
.
oh never mind did not see:
working-directory: 'frontend'
Your artifacts' location is
./frontend/dist
.
This is my new code and have the same error:
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ['main']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: 'frontend'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: 20
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Deploy to GitHub Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: ./frontend/dist
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
source: dist
If you check your last run: https://github.com/daironpf/SocialSeed/actions/runs/8902313032
You can see that your artifact has been published. It is named dist
because you are specifying a custom artifact name.
That's all good but for actions/deploy-pages
you are not passing dist
in the right place. We don't have a source
input. We have an artifact_name
one.
So this line specifically is wrong: https://github.com/daironpf/SocialSeed/blob/2859f681d9fcd329e91f42b78bb3ab989684aa9d/.github/workflows/jekyll-gh-pages.yml#L58
Replace it with:
artifact_name: dist
That should go further.
Hello, I am deploying my page in vuejs vite(is the frontend of open source project) to github page with github action but the artifact is giving me an error, could someone help me with this problem. Greetings
I attach the photo of my error and the link to my github action.
here the link to the action file