bchiang7 / v4

Fourth iteration of my personal website built with Gatsby
https://v4.brittanychiang.com/
MIT License
7.48k stars 3.69k forks source link

[Feature] - Auto Deployment of Your Fork/Website #211

Open adithyaakrishna opened 2 years ago

adithyaakrishna commented 2 years ago

Hi All πŸ‘‹πŸ» I am a huge fan of this portfolio website and have been using it for like an year and half. One issue for me was that I had to clone, make changes and run npm run deploy Deploy Script the site to deploy on GitHub Pages which would take quite some time and I was not able to make changes on the go be it through GitHub UI (Both PC & Mobile). So I wanted a GitHub Action to run whenever I make some changes and commit it to a specific branch using the GitHub UI itself. Hence I kind-of wrote a workflow for this,

name: Deploy Website πŸ•Έ
on:
  push:
    branches:
      - source # Change the branch name to your main one in which source code is there 
jobs:
  Build-N-Deploy:
    concurrency: ci-${{ github.ref }}
    runs-on: ubuntu-latest
    steps:
      - name: Checkout πŸ›ŽοΈ
        uses: actions/checkout@v3

      - name: Install and Build πŸ”§
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 
        run: |
          git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
          yarn
          npm run deploy

Note: For this to run, you need the npm run deploy configured

Hope this helps someone πŸš€

PS. Thanks @bchiang7 for this amazing portfolio :)

abhay2510kr commented 1 year ago

Hey

Can u please help me out to deploy this website on github pages

What steps i have to follow to edit this and run this