Refactor GitHub Actions workflow for combined deployment and improved… #32
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: Deploy to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout main branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| path: main-content | |
| - name: Checkout dev branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: dev | |
| path: dev-content | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Prepare combined deployment | |
| run: | | |
| mkdir -p _site | |
| cp -r main-content/* _site/ 2>/dev/null || true | |
| mkdir -p _site/dev | |
| cp -r dev-content/* _site/dev/ 2>/dev/null || true | |
| rm -rf _site/. git _site/.github _site/dev/.git _site/dev/. github | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| - name: Comment deployment URL | |
| run: | | |
| echo "✅ Deployed successfully!" | |
| echo "📦 Main branch: https://mralders0n.github.io/MeshCore-GOME-WarDriver/" | |
| echo "🔧 Dev branch: https://mralders0n.github.io/MeshCore-GOME-WarDriver/dev/" |