{"id":19818329,"url":"https://github.com/erickks/vite-deploy","last_synced_at":"2025-05-16T05:06:48.875Z","repository":{"id":158380814,"uuid":"594147272","full_name":"ErickKS/vite-deploy","owner":"ErickKS","description":"Guide for vite react app deploy","archived":false,"fork":false,"pushed_at":"2024-12-03T14:24:53.000Z","size":84,"stargazers_count":354,"open_issues_count":6,"forks_count":69,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-08T15:11:53.819Z","etag":null,"topics":["deploy","react","vite"],"latest_commit_sha":null,"homepage":"","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ErickKS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-27T17:58:21.000Z","updated_at":"2025-03-30T21:41:27.000Z","dependencies_parsed_at":"2024-12-29T20:11:10.363Z","dependency_job_id":"e3dc161a-9120-486b-be25-38fee2fde9f6","html_url":"https://github.com/ErickKS/vite-deploy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErickKS%2Fvite-deploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErickKS%2Fvite-deploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErickKS%2Fvite-deploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErickKS%2Fvite-deploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ErickKS","download_url":"https://codeload.github.com/ErickKS/vite-deploy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471061,"owners_count":22076585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deploy","react","vite"],"created_at":"2024-11-12T10:15:21.857Z","updated_at":"2025-05-16T05:06:43.861Z","avatar_url":"https://github.com/ErickKS.png","language":"CSS","readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch2\u003e⚜️ V I T E \u0026nbsp; D E P L O Y ⚜️\u003c/h2\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch4\u003eFollow the steps below to deploy your React application on GitHub.\u003c/h4\u003e\n    \u003ca href=\"https://www.youtube.com/watch?v=XhoWXhyuW_I\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Youtube_Video%20-%0A66C2.svg?\u0026style=for-the-badge\u0026logo=YouTube\u0026logoColor=FF0000\u0026color=282828\" /\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n#### 01. Create a vite react app\n```npm\nnpm create vite@latest\n```\n\n#### 02. Create a new repository on GitHub and initialize GIT\n```git\ngit init \ngit add . \ngit commit -m \"add: initial files\" \ngit branch -M main \ngit remote add origin https://github.com/[USER]/[REPO_NAME] \ngit push -u origin main\n```\n\n#### 03. Setup base in *vite.config*\n```js\nbase: \"/[REPO_NAME]/\"\n```\n\n#### 04. Create ./github/workflows/deploy.yml and add the code bellow\n\u003e [!WARNING]\n\u003e It is crucial that the `.yml` file has the exact code below. Any typing or spacing errors may cause deployment issues.\n```yml\nname: Deploy\n\non:\n  push:\n    branches:\n      - main\n\njobs:\n  build:\n    name: Build\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout repo\n        uses: actions/checkout@v3\n\n      - name: Setup Node\n        uses: actions/setup-node@v3\n\n      - name: Install dependencies\n        uses: bahmutov/npm-install@v1\n\n      - name: Build project\n        run: npm run build\n\n      - name: Upload production-ready build files\n        uses: actions/upload-artifact@v3\n        with:\n          name: production-files\n          path: ./dist\n\n  deploy:\n    name: Deploy\n    needs: build\n    runs-on: ubuntu-latest\n    if: github.ref == 'refs/heads/main'\n\n    steps:\n      - name: Download artifact\n        uses: actions/download-artifact@v3\n        with:\n          name: production-files\n          path: ./dist\n\n      - name: Deploy to GitHub Pages\n        uses: peaceiris/actions-gh-pages@v3\n        with:\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n          publish_dir: ./dist\n```\n\n#### 05. Push to GitHub\n```git\ngit add . \ngit commit -m \"add: deploy workflow\" \ngit push\n```\n\n#### 06. Active workflow (GitHub)\n```\nConfig \u003e Actions \u003e General \u003e Workflow permissions \u003e Read and Write permissions \n```\n```\nActions \u003e failed deploy \u003e re-run-job failed jobs \n```\n```\nPages \u003e gh-pages \u003e save\n```\n\n## 🛠 Helper\n\n#### \u003e For code changes\nWhenever you push to GitHub, it will deploy automatically.\n```git\ngit add . \ngit commit -m \"fix: some bug\" \ngit push\n```\n\n#### \u003e Fixing the 404 page error on routes.\nWatch my video on YouTube or check my repository.\n\n\u003ca href=\"https://youtu.be/uEEj2c3_ydg?si=XiUEL9h1WUmfjtkt\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Video%20-%0A66C2.svg?\u0026style=for-the-badge\u0026logo=YouTube\u0026logoColor=FF0000\u0026color=282828\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/ErickKS/vite-react-router\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Repository%20-%0A66C2.svg?\u0026style=for-the-badge\u0026logo=GitHub\u0026logoColor=FFFFFF\u0026color=282828\" /\u003e\n\u003c/a\u003e\n\n\u003cbr/\u003e\n\n#### \u003e Do you want to automate the project setup process ( `.yml` and `vite.config` )?\nTo prevent possible errors in the deploy process, check out this pull request:\n\n\u003ca href=\"https://github.com/ErickKS/vite-deploy/pull/1\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Pull_Request%20-%0A66C2.svg?\u0026style=for-the-badge\u0026logo=GitHub\u0026logoColor=FFFFFF\u0026color=282828\" /\u003e\n\u003c/a\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferickks%2Fvite-deploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferickks%2Fvite-deploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferickks%2Fvite-deploy/lists"}