- Add workflow_dispatch to ci-main.yml for manual full pipeline runs - Add workflow_dispatch to cd-deploy.yml with component selection - Update documentation with UI deployment instructions - Allow backend and web deployment via Forgejo UI Actions tab
92 lines
2.3 KiB
YAML
92 lines
2.3 KiB
YAML
name: Deploy Applications
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, master ]
|
|
workflow_dispatch:
|
|
inputs:
|
|
component:
|
|
description: 'Component to deploy'
|
|
required: false
|
|
default: 'all'
|
|
type: choice
|
|
options:
|
|
- all
|
|
- backend
|
|
- web
|
|
- mobile
|
|
|
|
jobs:
|
|
deploy-backend:
|
|
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch'
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup SSH
|
|
uses: webfactory/ssh-agent@v0.9.0
|
|
with:
|
|
ssh-private-key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
|
|
|
|
- name: Add server to known hosts
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
ssh-keyscan -H 147.45.152.129 >> ~/.ssh/known_hosts
|
|
|
|
- name: Deploy backend
|
|
run: |
|
|
cd tools/deploy
|
|
chmod +x backend-build_app.sh
|
|
./backend-build_app.sh
|
|
|
|
deploy-web:
|
|
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch'
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup SSH
|
|
uses: webfactory/ssh-agent@v0.9.0
|
|
with:
|
|
ssh-private-key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
|
|
|
|
- name: Add server to known hosts
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
ssh-keyscan -H 147.45.152.129 >> ~/.ssh/known_hosts
|
|
|
|
- name: Deploy web app
|
|
run: |
|
|
cd tools/deploy/web-app
|
|
chmod +x deploy.sh
|
|
./deploy.sh
|
|
|
|
deploy-mobile:
|
|
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Create release notes
|
|
run: |
|
|
echo "🚀 New release from $(date)" > release_notes.md
|
|
echo "" >> release_notes.md
|
|
echo "## Changes" >> release_notes.md
|
|
git log --oneline -10 >> release_notes.md
|
|
|
|
- name: Create GitHub release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: v$(date +%Y%m%d_%H%M%S)
|
|
name: "Release $(date +%Y-%m-%d)"
|
|
body_path: release_notes.md
|
|
draft: false
|
|
prerelease: false
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|