This website collects cookies to deliver better user experience
npx create-react-app app_name
npm run build
.yml
Create a netlify.toml file and then add the following code:
[build]
command = "npm run build"
publish = "build"
Drag and drop your build folder into your netlify site.
Generate a personal access token on netlify by going in user settings, applications and copy it to github secret.
name: CI/CD on: push: branches: [ your_branch_name ] pull_request: branches: [ your_branch_name ] jobs: build: runs-on: ubuntu-latest strategy: matrix: node-version: [12.x, 14.x] steps: - name: Checkout repository uses: actions/checkout@v2 - name: Set up Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - name: Install dependencies run: npm install - name: Run the tests run: npm test - name: Build run: npm run build - name: Deploy Site env: NETLIFY_SITE_ID: ${{ secrets.GITHUB_TOKEN_NAME }} NETLIFY_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN_NAME }} run: netlify deploy --prod
26
0