diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml new file mode 100644 index 0000000..d7e55d5 --- /dev/null +++ b/.github/workflows/cicd.yml @@ -0,0 +1,34 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: [ master ] + +permissions: + contents: read + pages: write + id-token: write +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout Source + uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Install Dependencies + run: npm ci + - name: Build Project + run: npm run build + - name: Upload artifacts + uses: actions/upload-pages-artifact@v3 + with: + name: 'github-pages' + path: build + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + artifact_name: 'github-pages' \ No newline at end of file diff --git a/package.json b/package.json index 59a6958..a9cf9af 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "react-app", "version": "0.1.0", "private": true, + "homepage": "https://chary5624.github.io/reactjs-app/", "dependencies": { "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0",