Compare commits
2 commits
b3a3a2f8eb
...
867361c3cc
| Author | SHA1 | Date | |
|---|---|---|---|
| 867361c3cc | |||
| f0fe64980f |
2 changed files with 7 additions and 70 deletions
|
|
@ -14,11 +14,6 @@ jobs:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# - name: Setup Node.js
|
|
||||||
# uses: https://code.forgejo.org/actions/setup-node@v4
|
|
||||||
# with:
|
|
||||||
# node-version: "22"
|
|
||||||
|
|
||||||
- name: Cache node modules
|
- name: Cache node modules
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
|
|
@ -49,10 +44,10 @@ jobs:
|
||||||
temp:dist-${{ env.FORGEJO_REF_NAME }} \
|
temp:dist-${{ env.FORGEJO_REF_NAME }} \
|
||||||
--force
|
--force
|
||||||
|
|
||||||
# - name: Trigger deployment webhook
|
- name: Trigger deployment webhook
|
||||||
# env:
|
env:
|
||||||
# DEPLOY_WEBHOOK: ${{ secrets.COOLIFY_STAGE_DEPLOY_WEBHOOK }}
|
DEPLOY_WEBHOOK: ${{ secrets.COOLIFY_STAGE_DEPLOY_WEBHOOK }}
|
||||||
# DEPLOY_TOKEN: ${{ secrets.COOLIFY_STAGE_DEPLOY_TOKEN }}
|
DEPLOY_TOKEN: ${{ secrets.COOLIFY_STAGE_DEPLOY_TOKEN }}
|
||||||
# run: |
|
run: |
|
||||||
# curl -v "$DEPLOY_WEBHOOK" \
|
curl -v "$DEPLOY_WEBHOOK" \
|
||||||
# --header "Authorization: Bearer $DEPLOY_TOKEN"
|
--header "Authorization: Bearer $DEPLOY_TOKEN"
|
||||||
|
|
|
||||||
58
.github/workflows/build-and-deploy.yml
vendored
58
.github/workflows/build-and-deploy.yml
vendored
|
|
@ -1,58 +0,0 @@
|
||||||
name: Build Astro and deploy dist
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- stage
|
|
||||||
- prod
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write # 👈 This is required for pushing branches
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
# Dynamically set environment name based on branch
|
|
||||||
environment: ${{ github.ref_name }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: "22" # match your project
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Build Astro project
|
|
||||||
run: npm run build
|
|
||||||
|
|
||||||
- name: Deploy dist to dist-${{ github.ref_name }}
|
|
||||||
run: |
|
|
||||||
# Configure Git
|
|
||||||
git config user.name "github-actions[bot]"
|
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
|
|
||||||
# Create temporary branch
|
|
||||||
git checkout --orphan temp-build
|
|
||||||
|
|
||||||
# Clean it
|
|
||||||
git rm -rf .
|
|
||||||
|
|
||||||
# Commit and force push
|
|
||||||
git add dist
|
|
||||||
|
|
||||||
git branch
|
|
||||||
git commit -m "Update dist/ [skip ci]"
|
|
||||||
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} temp-build:dist-${{ github.ref_name }} --force
|
|
||||||
|
|
||||||
- name: Trigger deployment webhook
|
|
||||||
run: |
|
|
||||||
curl -v "$DEPLOY_WEBHOOK" --header "Authorization: Bearer $DEPLOY_TOKEN"
|
|
||||||
env:
|
|
||||||
DEPLOY_WEBHOOK: ${{ secrets.COOLIFY_DEPLOY_WEBHOOK }}
|
|
||||||
DEPLOY_TOKEN: ${{ secrets.COOLIFY_DEPLOY_TOKEN }}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue