Merge branch 'stage' into prod

This commit is contained in:
Christoph Haas 2025-11-02 13:25:21 +01:00
commit 64ad7eb177

View file

@ -3,16 +3,18 @@ name: Build Astro and deploy dist
on: on:
push: push:
branches: branches:
- prod # or your default branch - stage
- prod
workflow_dispatch: workflow_dispatch:
permissions: permissions:
contents: write # 👈 This is required for pushing branches contents: write # 👈 This is required for pushing branches
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment: prod # Dynamically set environment name based on branch
environment: ${{ github.ref_name }}
steps: steps:
- name: Checkout code - name: Checkout code
@ -21,7 +23,7 @@ jobs:
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: '22' # match your project node-version: "22" # match your project
- name: Install dependencies - name: Install dependencies
run: npm ci run: npm ci
@ -29,24 +31,24 @@ jobs:
- name: Build Astro project - name: Build Astro project
run: npm run build run: npm run build
- name: Deploy dist to dist-prod - name: Deploy dist to dist-${{ github.ref_name }}
run: | run: |
# Configure Git # Configure Git
git config user.name "github-actions[bot]" git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com" git config user.email "github-actions[bot]@users.noreply.github.com"
# Create temporary branch # Create temporary branch
git checkout --orphan temp-build git checkout --orphan temp-build
# Clean it # Clean it
git rm -rf . git rm -rf .
# Commit and force push # Commit and force push
git add dist git add dist
git branch git branch
git commit -m "Update dist/ [skip ci]" git commit -m "Update dist/ [skip ci]"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/Signum/ispmail-workaround-org.git temp-build:dist-prod --force git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} temp-build:dist-${{ github.ref_name }} --force
- name: Trigger deployment webhook - name: Trigger deployment webhook
run: | run: |
@ -54,4 +56,3 @@ jobs:
env: env:
DEPLOY_WEBHOOK: ${{ secrets.COOLIFY_DEPLOY_WEBHOOK }} DEPLOY_WEBHOOK: ${{ secrets.COOLIFY_DEPLOY_WEBHOOK }}
DEPLOY_TOKEN: ${{ secrets.COOLIFY_DEPLOY_TOKEN }} DEPLOY_TOKEN: ${{ secrets.COOLIFY_DEPLOY_TOKEN }}