This repository has been archived on 2023-05-02. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
neo/.github/workflows/update-server.yml
Didier 17363e14f1
Some checks failed
update neo with compose files / validate (push) Failing after 27s
update neo with compose files / update (push) Has been skipped
attempt 2
2023-04-29 23:46:16 +02:00

51 lines
No EOL
1.6 KiB
YAML

name: update neo with compose files
run-name: update on ${{ github.sha }}
on: [push]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: install docker-compose
run: |
apt update -y
apt install -y \
docker-compose
- name: check docker-compose
run: |
cd ${{ github.workspace }}
DC_ARGS=""
for f in docker-compose.*.yml; do
DC_ARGS="-f $f"
done
docker-compose $DC_ARGS config
update:
needs: [validate]
runs-on: ubuntu-latest
steps:
- name: setup ssh
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/staging.key
chmod 600 ~/.ssh/staging.key
cat >>~/.ssh/config <<END
Host staging
HostName $SSH_HOST
Port $SSH_PORT
User $SSH_USER
IdentityFile ~/.ssh/staging.key
StrictHostKeyChecking no
END
env:
SSH_HOST: neo.ixvd.net
SSH_PORT: ${{ secrets.SSH_PORT }}
SSH_USER: automation
SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
- name: update git
run: ssh staging srvctl -fn neo mm u git
- name: clean docker compose
run: ssh staging srvctl -fn neo mm c
- name: enforce new config
run: ssh staging srvctl -fn neo mm e
- name: send ping to ntfy
if: always()
run: "curl -d '${{ job.status }}: ${{ github.sha }}\n https://git.ixvd.net/${{ github.repository }}/actions/runs/${{ github.run_number }}' https://push.ixvd.net/${{ secrets.NTFY_TOPIC }}"