feat(instructions): add new copilot-instructions file #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and deploy Jekyll site to GitHub Pages | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| # Build job | |
| build: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| pages_enabled: ${{ steps.pages.outcome == 'success' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.1' # Not needed with a .ruby-version file | |
| bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
| cache-version: 0 # Increment this number if you need to re-download cached gems | |
| - name: Setup Pages | |
| id: pages | |
| uses: actions/configure-pages@v5 | |
| continue-on-error: true | |
| - name: Check Pages Status | |
| if: steps.pages.outcome == 'failure' | |
| run: | | |
| echo "⚠️ GitHub Pages is not enabled for this repository." | |
| echo "📖 To enable GitHub Pages:" | |
| echo " 1. Go to repository Settings" | |
| echo " 2. Navigate to 'Pages' in the sidebar" | |
| echo " 3. Under 'Source', select 'GitHub Actions'" | |
| echo " 4. Save the settings" | |
| echo " 5. Re-run this workflow" | |
| echo "" | |
| echo "💡 This workflow will build the site but skip deployment until Pages is enabled." | |
| - name: Build with Jekyll | |
| # Outputs to the './_site' directory by default | |
| run: | | |
| if [[ "${{ steps.pages.outcome }}" == "success" ]]; then | |
| bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" | |
| else | |
| bundle exec jekyll build | |
| fi | |
| env: | |
| JEKYLL_ENV: production | |
| - name: Upload artifact | |
| # Only upload if Pages is properly configured | |
| if: steps.pages.outcome == 'success' | |
| # Automatically uploads an artifact from the './_site' directory by default | |
| uses: actions/upload-pages-artifact@v3 | |
| - name: Upload artifact for preview | |
| # If Pages is not configured, still upload as regular artifact for review | |
| if: steps.pages.outcome == 'failure' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: github-pages | |
| path: _site/ | |
| retention-days: 1 | |
| # Deployment job | |
| deploy: | |
| # Only deploy if Pages is configured and we're on main branch | |
| if: github.ref == 'refs/heads/main' && needs.build.outputs.pages_enabled == 'true' | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |