Skip to content

Merge pull request #49 from hacksu/2025-Fall-Refresh #34

Merge pull request #49 from hacksu/2025-Fall-Refresh

Merge pull request #49 from hacksu/2025-Fall-Refresh #34

name: Build and Deploy
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [master]
#pull_request:
#branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
concurrency:
group: automatic_deployment
cancel-in-progress: true
name: Deploy
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Deploy to server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
#passphrase: ${{ secrets.KEY_PASSPHRASE }}
script: |
cd /var/www/hacksu-2021
echo "Fetching changes from Github"
git fetch
echo "Pulling Changes from Github"
git pull
echo "Building docker"
docker compose build
echo "Starting docker"
docker compose up -d --force-recreate