This commit is contained in:
42
.gitea/workflows/publish.yml
Normal file
42
.gitea/workflows/publish.yml
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
name: Publish Website
|
||||||
|
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ] # ✅ Fixed typo from 'braches'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout website repo
|
||||||
|
uses: actions/checkout@v4 # ✅ Indented correctly; moved under step
|
||||||
|
|
||||||
|
- name: Set up SSH agent
|
||||||
|
env:
|
||||||
|
SSH_KEY: ${{ secrets.ACCESS_KEY }}
|
||||||
|
run: |
|
||||||
|
eval "$(ssh-agent -s)"
|
||||||
|
echo "$SSH_KEY" | tr -d '\r' | ssh-add -
|
||||||
|
ssh-add -l
|
||||||
|
|
||||||
|
- name: Trust your Gitea host
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
ssh-keyscan "localhost" >> ~/.ssh/known_hosts # ✅ Fixed typo "locahost" → "localhost"
|
||||||
|
|
||||||
|
- name: Clone template repo
|
||||||
|
run: |
|
||||||
|
git clone --depth 1 ssh://git@localhost:222/app_templates /tmp/template
|
||||||
|
|
||||||
|
- name: Copy Docker configuration
|
||||||
|
run: |
|
||||||
|
cp /tmp/template/web/docker-compose.yml .
|
||||||
|
cp /tmp/template/web/Dockerfile .
|
||||||
|
|
||||||
|
- name: Stop existing stack
|
||||||
|
run: docker compose down --remove-orphans || true
|
||||||
|
|
||||||
|
- name: Rebuild and deploy
|
||||||
|
run: docker compose up -d --build
|
Reference in New Issue
Block a user