ispmail-workaround-org/.forgejo/workflows/playing-around.yaml
Christoph Haas 28431dbef9
All checks were successful
/ build (push) Successful in 50s
ffs
2025-12-27 00:52:20 +01:00

58 lines
1.6 KiB
YAML

on:
push:
branches:
- stage
jobs:
build:
runs-on: docker
#environment: ${{ env.FORGEJO_REF_NAME }}
container:
image: node:22
steps:
- name: Checkout code
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
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Build Astro project
run: npm run build
- name: Deploy dist to dist-${{ env.FORGEJO_REF_NAME }}
run: |
git config user.name "forgejo-actions[bot]"
git config user.email "forgejo-actions[bot]@users.noreply.local"
git checkout --orphan temp
git rm -rf .
git add dist
git commit -m "Update dist"
git push \
"https://x-access-token:${{ secrets.FORGEJO_TOKEN }}@git.workaround.org/${{ github.repository }}.git" \
temp:dist-${{ env.FORGEJO_REF_NAME }} \
--force
# - name: Trigger deployment webhook
# env:
# DEPLOY_WEBHOOK: ${{ secrets.COOLIFY_STAGE_DEPLOY_WEBHOOK }}
# DEPLOY_TOKEN: ${{ secrets.COOLIFY_STAGE_DEPLOY_TOKEN }}
# run: |
# curl -v "$DEPLOY_WEBHOOK" \
# --header "Authorization: Bearer $DEPLOY_TOKEN"