diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6c62c8b..03a4fb0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,23 +3,34 @@ name: Deploy GitHub Pages on: push: branches: - - main + - main # Trigger the workflow on pushes to the 'main' branch jobs: deploy: - runs-on: ubuntu-latest + runs-on: ubuntu-latest # Use the latest Ubuntu runner + steps: - - uses: actions/checkout@v4 - # Install dependencies and build your website if needed - # - run: npm install - # - run: npm run build - # Add custom domain information to ensure it's not removed + - name: Checkout repository + uses: actions/checkout@v4 # Checkout the code in the repository + + - name: Set up Node.js + uses: actions/setup-node@v3 # Set up Node.js + with: + node-version: '16' # Specify the version of Node.js you want to use + + - name: Install dependencies + run: npm install # Install project dependencies + + - name: Build the React app + run: npm run build # Build the app for production + - name: Set up custom domain run: | - echo 'tinymlhack.com' > ./public/CNAME - # Deploy to GitHub Pages + echo 'tinymlhack.com' > ./build/CNAME # Ensure the custom domain is included in the build folder + - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v4 + uses: peaceiris/actions-gh-pages@v4 # Deploy to GitHub Pages with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./public + github_token: ${{ secrets.GITHUB_TOKEN }} # Use the GitHub token for authentication + publish_dir: ./build # Publish the 'build' directory for deployment +