35 lines
913 B
YAML
35 lines
913 B
YAML
name: Deploy to Production
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- v[0-9]+.[0-9]+.[0-9]+
|
|
|
|
jobs:
|
|
deploy-to-production:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Copy docker-compose.yml to server
|
|
uses: appleboy/scp-action@v0.1.7
|
|
with:
|
|
host: ${{ secrets.HOST }}
|
|
username: ${{ secrets.USERNAME }}
|
|
key: ${{ secrets.KEY }}
|
|
source: "compose-file/docker-compose.yml"
|
|
target: "/home/${{ secrets.USERNAME }}/minecraft-server-ironveil"
|
|
strip_components: 1
|
|
|
|
- name: Deploy and restart container
|
|
uses: appleboy/ssh-action@v1.2.5
|
|
with:
|
|
host: ${{ secrets.HOST }}
|
|
username: ${{ secrets.USERNAME }}
|
|
key: ${{ secrets.KEY }}
|
|
script: |
|
|
cd minecraft-server-ironveil
|
|
docker compose pull
|
|
docker compose up -d --force-recreate
|