30 lines
531 B
YAML
30 lines
531 B
YAML
name: Build and Deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: Runner
|
|
|
|
env:
|
|
APP_DIR: /opt/docker/apps/sveltekit-test
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build Docker image
|
|
run: |
|
|
docker build -t sveltekit-test:latest .
|
|
|
|
- name: Deploy
|
|
run: |
|
|
mkdir -p $APP_DIR
|
|
cp compose.yml $APP_DIR/compose.yml
|
|
cd $APP_DIR
|
|
docker compose up -d
|
|
docker image prune -f
|