fixes #41
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: Mod Dev Branding Site | |
| # mainly for testing purposes | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| branches: ["**"] | |
| jobs: | |
| build: | |
| name: Build site source | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: "1.25" | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - name: Install Node dependencies | |
| run: npm ci | |
| - name: Build project (tsc, vite, service) | |
| run: npm run build | |
| - name: Ensure service binary is executable | |
| run: | | |
| if [ -f build/service ]; then chmod +x build/service; fi | |
| - name: Upload frontend artifact | |
| run: | | |
| rm -rf artifacts/frontend-dist | |
| mkdir -p artifacts/frontend-dist/dist | |
| cp -r dist/* artifacts/frontend-dist/dist/ | |
| - name: Upload frontend artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: frontend-dist | |
| path: artifacts/frontend-dist | |
| - name: Upload service binary artifact | |
| run: | | |
| rm -rf artifacts/service-binary | |
| mkdir -p artifacts/service-binary | |
| cp build/service artifacts/service-binary/service | |
| - name: Upload service binary artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: service-binary | |
| path: artifacts/service-binary | |
| package: | |
| name: Package release | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Download frontend artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: frontend-dist | |
| path: frontend-dist | |
| - name: Download service artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: service-binary | |
| path: service-binary | |
| - name: Reapply executable bit to service binary | |
| run: chmod +x service-binary/service | |
| - name: Create release bundle | |
| run: | | |
| set -euo pipefail | |
| rm -rf release | |
| mkdir -p release | |
| if [ -d frontend-dist/dist ]; then | |
| cp -r frontend-dist/dist release/dist | |
| else | |
| echo "frontend-dist/dist not found" >&2 | |
| exit 1 | |
| fi | |
| if [ -f service-binary/service ]; then | |
| cp service-binary/service release/ | |
| else | |
| echo "service-binary/service not found" >&2 | |
| exit 1 | |
| fi | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release | |
| path: release |