\n
I want to be https://mortezasabihi.github.io.
\nthis is my gh action:
\n \nname: cd\n\non: [push, pull_request]\n\njobs:\n cd:\n runs-on: ${{ matrix.os }}\n\n strategy:\n matrix:\n os: [ubuntu-latest]\n node: [14]\n\n steps:\n - name: Checkout\n uses: actions/checkout@master\n\n - name: Setup node env\n uses: actions/setup-node@v2.1.2\n with:\n node-version: ${{ matrix.node }}\n\n - name: Install dependencies\n run: yarn\n\n - name: Generate\n run: yarn run generate\n\n - name: Deploy\n uses: peaceiris/actions-gh-pages@v3\n with:\n github_token: ${{ secrets.GITHUB_TOKEN }}\n publish_dir: ./dist\n
\nwhat's wrong? I didn't understand!
\n","author":{"@type":"Person","name":"ShaSha"},"upvoteCount":0,"answerCount":2,"acceptedAnswer":null}}Reputation: 699
Hi i created a repository with the same name of my github account called mortezasabihi. and in this repository i pushed my personal website (nuxtjs static) to it and created github action for autodeployment, but I don't know why my github page URL is this:
I want to be https://mortezasabihi.github.io.
this is my gh action:
name: cd
on: [push, pull_request]
jobs:
cd:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [14]
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup node env
uses: actions/setup-node@v2.1.2
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: yarn
- name: Generate
run: yarn run generate
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
what's wrong? I didn't understand!
Upvotes: 0
Views: 656
Reputation: 1637
I have my personal website on Github pages too, and use this strategy:
I create a branch named development
and working on that branch.
Based on Nuxt
documentation, I add some script in my package.json
file:
"scripts": {
"dev": "nuxt",
"generate": "nuxt generate",
"start": "nuxt start",
"deploy": "push-dir --dir=dist --branch=master --cleanup"
},
and when running these commands, the dist
folder automatically will be pushed to master.
npm run generate
npm run deploy
Upvotes: 0
Reputation: 23338
The own action-gh-pages documentation allows you to configure many things inside your workflow file.
You can have one site published to https://<username>.github.io
by publishing to the master
(or main
) branch of a repository named “username.github.io” (substituting your actual username
), as explained here.
You can also have an additional site per GitHub project published to https://<username>.github.io/<project>
(which seems to be what you did here using your username profile repository).
Project sites will publish whatever you push to the gh-pages
branch by default, but you can change the publishing source in the repository settings.
Another description is available in the GitHub Pages documentation, including options for using custom domain names.
Upvotes: 2