Skip to content

Commit

Permalink
feat: add gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninjagod1251 committed Nov 14, 2024
1 parent d8dfd8d commit dc56c76
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 13 deletions.
43 changes: 37 additions & 6 deletions .github/workflows/backend-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,48 @@
name: Deploy Backend
name: Deploy Bot to Railway

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]

jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --ha=false --remote-only
- name: Checkout
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'

- name: Install Railway CLI
run: |
curl -fsSL https://railway.app/install.sh | sh
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: |
python tests/test_manual.py --check
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
CLAUDE_KEY: ${{ secrets.CLAUDE_KEY }}

- name: Deploy to Railway
run: |
railway up --service ${{ secrets.RAILWAY_SERVICE_NAME }}
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
CLAUDE_KEY: ${{ secrets.CLAUDE_KEY }}

permissions:
contents: read
45 changes: 38 additions & 7 deletions .github/workflows/landing-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,60 @@ on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'
cache: 'npm'
cache-dependency-path: './landing-page/package-lock.json'

- name: Install Dependencies
run: npm install
run: npm ci
working-directory: ./landing-page

- name: Lint
run: npm run lint
working-directory: ./landing-page

- name: Build
run: npm run build
working-directory: ./landing-page
env:
CI: true
NODE_ENV: production

- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
- name: Install Railway CLI
run: |
curl -fsSL https://railway.app/install.sh | sh
- name: Deploy to Railway
run: |
railway up \
--service ${{ secrets.RAILWAY_LANDING_SERVICE }} \
--detach
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}

- name: Deploy to GitHub Pages (Backup)
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: landing-page/build
clean: true
single-commit: true

permissions:
contents: write

0 comments on commit dc56c76

Please sign in to comment.