From 7a3f8378c21540fcc61b77f31a0ae22e8eeb4c65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Viricel?= Date: Fri, 7 Feb 2025 16:17:22 +0100 Subject: [PATCH] feat: add deploy to CI --- .github/workflows/deploy.yml | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..0000b90 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,43 @@ +name: 🚀 Deploy Static Content to GitHub Pages + +on: push + +# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages +permissions: + contents: read # Read access to repository contents + pages: write # Write access for deployment to GitHub Pages + id-token: write # Allow GitHub to issue an ID token for authentication + +# Allow only one concurrent deployment at a time +concurrency: + group: pages # Group deployments by name for concurrency control + cancel-in-progress: true # Cancel any in-progress deployments if a new one starts + +jobs: + deploy: + name: 🚀 Deploy to GitHub Pages + if: github.ref == 'refs/heads/master' # Only deploy from the main branch + environment: + name: github-pages # Set deployment environment to GitHub Pages + url: ${{ steps.deployment.outputs.page_url }} # Output page URL + runs-on: ubuntu-latest + steps: + - name: Checkout Repository 📥 + uses: actions/checkout@v4 + - name: Set up Node.js v20 💻 + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Install Dependencies 🛠️ + run: npm ci + - name: Build Static Content 🏗️ + run: NODE_ENV=production npm run build + - name: Setup GitHub Pages ⚙️ + uses: actions/configure-pages@v4 + - name: Upload Build Artifacts 📦 + uses: actions/upload-pages-artifact@v3 + with: + path: ./build # Path to the build output directory + - name: Deploy to GitHub Pages 🌐 + id: deployment + uses: actions/deploy-pages@v4 # Deploy the build to GitHub Pages \ No newline at end of file