OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

problem for deployment with astro on github pages

  • Thread starter Thread starter Ayspeed
  • Start date Start date
A

Ayspeed

Guest
I can’t deploy my github portfolio using astro, but I configured all the files.

So I share my code:

astro.config.mjs

Code:
import { defineConfig } from 'astro/config';


export default defineConfig({
    site: 'https://myusername.github.io',
    base: '/portfolio',
    output: 'static',
});

.gihub/workflows/deploy.yml

Code:
name: Deploy to GitHub Pages

on:
  # Trigger the workflow every time you push to the `main` branch
  # Using a different branch name? Replace `main` with your branch’s name
  push:
    branches: [ main ]
  # Allows you to run this workflow manually from the Actions tab on GitHub.
  workflow_dispatch:

# Allow this job to clone the repo and create a page deployment
permissions:
  contents: read
  pages: write
  id-token: write

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout your repository using git
        uses: actions/checkout@v3
      - name: Install, build, and upload your site
        uses: withastro/action@v0
        # with:
          # path:  # The root location of your Astro project inside the repository. (optional)
            # node-version: 16 # The specific version of Node that should be used to build your site. Defaults to 16. (optional)
            # package-manager: yarn # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)

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

I already try to put it in a (docs) folder and change parameters but it didn't work. The deployment is successful but I have this error when I access the site :

File not found

The site configured at this address does not contain the requested file.

If this is your site, make sure that the filename case matches the URL as well as any file permissions.

Can someone help me please ?

Thanks
<p>I can’t deploy my github portfolio using astro, but I configured all the files.</p>
<p>So I share my code:</p>
<p>astro.config.mjs</p>
<pre><code>import { defineConfig } from 'astro/config';


export default defineConfig({
site: 'https://myusername.github.io',
base: '/portfolio',
output: 'static',
});
</code></pre>
<p>.gihub/workflows/deploy.yml</p>
<pre><code>name: Deploy to GitHub Pages

on:
# Trigger the workflow every time you push to the `main` branch
# Using a different branch name? Replace `main` with your branch’s name
push:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:

# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v3
- name: Install, build, and upload your site
uses: withastro/action@v0
# with:
# path: # The root location of your Astro project inside the repository. (optional)
# node-version: 16 # The specific version of Node that should be used to build your site. Defaults to 16. (optional)
# package-manager: yarn # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
</code></pre>
<p>I already try to put it in a (docs) folder and change parameters but it didn't work.
The deployment is successful but I have this error when I access the site :</p>
<p>File not found</p>
<p>The site configured at this address does not contain the requested file.</p>
<p>If this is your site, make sure that the filename case matches the URL as well as any file permissions.</p>
<p>Can someone help me please ?</p>
<p>Thanks</p>
Continue reading...
 

Latest posts

Online statistics

Members online
1
Guests online
2
Total visitors
3
Top