SindreKjelsrud
234c0db365
Some checks are pending
Deploy website / build-and-deploy (push) Waiting to run
Signed-off-by: SindreKjelsrud <sindre@kjelsrud.dev>
31 lines
852 B
YAML
31 lines
852 B
YAML
name: Deploy website
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths-ignore:
|
|
- 'README.md' # Ignore changes to README.md
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: littlegarden
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up SSH
|
|
uses: webfactory/ssh-agent@v0.5.3
|
|
with:
|
|
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
|
|
- name: Add remote host to known_hosts
|
|
run: ssh-keyscan drumisland >> ~/.ssh/known_hosts
|
|
|
|
|
|
- name: Sync files with rsync to remote server
|
|
run: |
|
|
rsync -avz --exclude='.git' --exclude='.github' --exclude='README.md' ./ sid@drumisland:kjelsrud.dev/
|
|
|
|
- name: Run docker-compose on remote server
|
|
run: ssh -o StrictHostKeyChecking=no sid@drumisland "cd kjelsrud.dev && docker-compose up -d --build"
|
|
|