43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
name: Publish Website
|
|
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout website repo
|
|
run: git clone https://code.akshaykolli.net/lepton/website
|
|
|
|
- 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 Gitea host
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
ssh-keyscan -p 222 localhost >> ~/.ssh/known_hosts
|
|
|
|
- name: Clone template repo
|
|
run: |
|
|
git clone --depth 1 ssh://git@localhost:222/lepton/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
|