snowflake/.forgejo/workflows/deployment/deploy-systems.yml

35 lines
999 B
YAML
Raw Normal View History

2023-10-20 19:30:57 -04:00
name: deploy systems
on:
push:
2023-11-05 11:13:37 -05:00
branches:
2023-11-05 11:14:14 -05:00
- master
2023-10-20 19:30:57 -04:00
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install nix action
uses: https://github.com/DeterminateSystems/nix-installer-action@v5
with:
github-token: ${{ secrets.GH_TOKEN }}
2023-10-21 00:58:54 -04:00
- name: write private key
run: |
mkdir -p .ssh && cd .ssh
echo "$SSH_KEY" > forgejo
2023-10-21 02:20:28 -04:00
chmod 400 forgejo
2023-10-21 00:58:54 -04:00
shell: bash
env:
2023-10-21 01:23:14 -04:00
SSH_KEY: ${{secrets.SSH_DEPLOY_KEY}}
2023-10-20 19:30:57 -04:00
- name: deploy
run: |
2023-10-21 01:10:11 -04:00
cd .ssh
2023-10-21 03:24:20 -04:00
nix run github:serokell/deploy-rs -- --ssh-opts="-i forgejo -o StrictHostKeyChecking=no" --skip-checks --targets .#arashi .#kariru .#sakura .#sora .#yuki
2023-11-03 09:31:21 -04:00
- name: garbage collect
2023-11-05 11:13:37 -05:00
uses: https://github.com/appleboy/ssh-action@v1.0.0
2023-11-03 09:31:21 -04:00
with:
host: 100.82.146.40
username: root
key: ${{secrets.SSH_DEPLOY_KEY}}
2023-11-03 09:36:20 -04:00
script: nh clean all