mirror of
https://github.com/UiO-Gaming/name-100-uio-gamers.git
synced 2026-11-05 13:56:53 +01:00
The old workflow ran docker compose in the repo folder, which failed because the containers belong to the server's top-level compose project. The deploy key can now only run /usr/local/bin/uiogaming-deploy (see UiO-Gaming/drift), so the workflow just passes the service name. Also adds manual runs and prevents overlapping deploys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
33 lines
829 B
YAML
33 lines
829 B
YAML
name: Deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
# Never run two deploys of this repo at the same time
|
|
concurrency: deploy
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- name: Set up SSH
|
|
run: |
|
|
install -m 600 -D /dev/null ~/.ssh/id_ed25519
|
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
|
ssh-keyscan -H ${{ vars.SSH_HOST }} > ~/.ssh/known_hosts
|
|
|
|
# The deploy key can only run /usr/local/bin/uiogaming-deploy on the server. It takes the
|
|
# service name from the top-level docker-compose.yml (see drift/driftsdokumentasjon.md).
|
|
- name: Deploy
|
|
run: ssh ${{ secrets.SSH_USER }}@${{ vars.SSH_HOST }} name100
|
|
|
|
- name: Clean up
|
|
if: always()
|
|
run: rm -rf ~/.ssh
|