diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml new file mode 100644 index 0000000..dd0800b --- /dev/null +++ b/.github/workflows/deploy-production.yml @@ -0,0 +1,24 @@ +name: Deploy Production Site + +# Trigger on pushes to the main branch +on: + push: + branches: [ "main" ] + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + # Step 1: Check out the code from the main branch + - name: Checkout main + uses: actions/checkout@v4 + + # Step 2: Deploy to gh-pages branch (root directory) + - name: Deploy to Production + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} # Auto-generated by GitHub + publish_branch: gh-pages # Branch to deploy to + publish_dir: . # Directory with built files (use _site for Jekyll/Hugo) + destination_dir: . # Deploy to root of gh-pages + force_orphan: true # Keep gh-pages clean (only built files) diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml new file mode 100644 index 0000000..11c616a --- /dev/null +++ b/.github/workflows/deploy-staging.yml @@ -0,0 +1,24 @@ +name: Deploy Staging Site + +# Trigger on pushes to the staging branch +on: + push: + branches: [ "staging" ] + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + # Step 1: Check out the code from the staging branch + - name: Checkout staging + uses: actions/checkout@v4 + + # Step 2: Deploy to gh-pages branch (staging subdirectory) + - name: Deploy to Staging + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_branch: gh-pages + publish_dir: . # Same as production (e.g., _site for generators) + destination_dir: staging # Deploy to /staging in gh-pages + force_orphan: false # Don’t overwrite production files in gh-pages