From c84fbef172e7d899cf7bbdd7e844cdc46159eaeb Mon Sep 17 00:00:00 2001 From: Le Phat Loc <34123125+locle97@users.noreply.github.com> Date: Mon, 26 Aug 2024 13:32:29 +0700 Subject: [PATCH 1/2] Update azure-static-web-apps-gray-smoke-0c67d4200.yml --- .../workflows/azure-static-web-apps-gray-smoke-0c67d4200.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/azure-static-web-apps-gray-smoke-0c67d4200.yml b/.github/workflows/azure-static-web-apps-gray-smoke-0c67d4200.yml index 94501cb..65b28c1 100644 --- a/.github/workflows/azure-static-web-apps-gray-smoke-0c67d4200.yml +++ b/.github/workflows/azure-static-web-apps-gray-smoke-0c67d4200.yml @@ -1,11 +1,8 @@ name: Production - Azure Static Web Apps CI/CD on: - push: - branches: - - main pull_request: - types: [opened, synchronize, reopened, closed] + types: [closed] branches: - main workflow_dispatch: From c27b8ecae43b6ad47461e13bf7b68cc4a217acbc Mon Sep 17 00:00:00 2001 From: Loc Le Date: Mon, 26 Aug 2024 13:55:18 +0700 Subject: [PATCH 2/2] feat - update readme for deployment section --- README.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a614953..7858c69 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,37 @@ Start the development server and run the project locally npm run dev ``` +### Deployment + +1. Setup environment variables: + +- List of variables: + - VITE_WEB3FORMS_ACCESS_KEY: this access key is used to send email from contact page. You can get it from https://web3forms.com/#start + +- If you're deploying on VMs, modify the `.env` file to replace your access key +- If you're deploying via CI/CD pipeline (github actions, Azure,...), find a way to replace token with your secret key setup. + - Github actions: Setup environment secrets -> put step below into your workflow to replace token. + ``` + - name: Find and Replace API Keys + run: find .env -type f -exec sed -i ''s/#{WEB3FORMS_API_KEY}#/${{ secrets.WEB3FORMS_API_KEY }}/g'' {} \; + ``` + +2. Install dependencies + +Install the necessary packages using npm: +``` +npm install +``` + +3. Build + +Build the project and publish to folder dist +``` +npm run build +``` + +4. Copy dist to wwwroot folder + ## Built with - [React](https://react.dev/) @@ -49,7 +80,6 @@ npm run dev ## Roadmap -- **Deployment documentation**: Add a section to guide about production deployment. - **Dark mode**: Currently, the website only supports light mode. Adding a dark mode option will enhance user experience by providing a more comfortable viewing option, especially in low-light environments. - **Blog Integration**: Add a blog section to share insights, tutorials, or project updates. This can also serve as a way to showcase your knowledge and keep the content dynamic. - **Portfolio Expansion**: Add more projects and case studies, including detailed descriptions, challenges faced, and the solutions implemented. This will showcase the breadth of your work and skills.