mirror of
https://github.com/Lapikud/tipilan.git
synced 2026-03-23 13:24:21 +00:00
Initial github actions workflow for CI/CD
This commit is contained in:
34
.github/workflows/build.yml
vendored
Normal file
34
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
name: build
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: prox-1
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Check if Bun is installed
|
||||
id: check-bun
|
||||
run: |
|
||||
if command -v bun &> /dev/null; then
|
||||
echo "bun-exists=true" >> $GITHUB_OUTPUT
|
||||
echo "Bun is already installed: $(bun --version)"
|
||||
else
|
||||
echo "bun-exists=false" >> $GITHUB_OUTPUT
|
||||
echo "Bun is not installed"
|
||||
fi
|
||||
|
||||
- name: Setup Bun
|
||||
if: steps.check-bun.outputs.bun-exists == 'false'
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: latest
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
|
||||
- name: Build project
|
||||
run: bun --bun run build
|
||||
17
.github/workflows/deploy.yml
vendored
Normal file
17
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
name: deploy
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: prox-1
|
||||
steps:
|
||||
- name: Restart NextJS service
|
||||
run: sudo systemctl restart nextjs.service
|
||||
|
||||
- name: Reload systemd daemon
|
||||
run: sudo systemctl daemon-reload
|
||||
|
||||
- name: Check service status
|
||||
run: sudo systemctl status nextjs.service --no-pager
|
||||
14
.github/workflows/main.yml
vendored
Normal file
14
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
name: main
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
uses: ./.github/workflows/build.yml
|
||||
|
||||
deploy:
|
||||
needs: build
|
||||
uses: ./.github/workflows/deploy.yml
|
||||
Reference in New Issue
Block a user