Skip to content

[server/nextcloud] move maintainance_window_start to right place #67

[server/nextcloud] move maintainance_window_start to right place

[server/nextcloud] move maintainance_window_start to right place #67

Workflow file for this run

name: Deploy Server
on:
push:
branches:
- master
paths:
- 'nixos/server/**'
workflow_dispatch:
workflow_call:
secrets:
SSH_PRIVATE_KEY:
required: true
SSH_CONFIG:
required: true
KNOWN_HOSTS:
required: true
concurrency:
group: ${{ github.head_ref || github.ref }}
jobs:
deploy-server:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit
- name: Setup ssh-agent
uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 # v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Install SSH key
uses: shimataro/ssh-key-action@d4fffb50872869abe2d9a9098a6d9c5aa7d16be4 # v2.7.0
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
name: id_rsa # optional
known_hosts: ${{ secrets.KNOWN_HOSTS }}
config: ${{ secrets.SSH_CONFIG }} # ssh_config; optional
if_key_exists: fail
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Install nix
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # V27
with:
nix_path: nixpkgs=channel:nixos-24.05
- name: Use magix nix cache
uses: DeterminateSystems/magic-nix-cache-action@b46e247b898aa56e6d2d2e728dc6df6c84fdb738 # v7
- name: Check flake lock file
uses: DeterminateSystems/flake-checker-action@ae43dea95bc73541287cfd10e2dee994d1877291 # v8
with:
flake-lock-path: nixos/server/flake.lock
- name: Run nixos-rebuild
uses: workflow/nix-shell-action@10ebd4e80eae8a5bc5147c0a36ebb568d1b277bd # v3.3.2
with:
packages: nixos-rebuild
working-directory: nixos/server
script: |
sudo cp -r $HOME/.ssh /root
nixos-rebuild switch --fast --flake ".#nixos" --use-remote-sudo --target-host "[email protected]" --build-host "[email protected]" --builders "ssh://[email protected] aarch64-linux" || true
nixos-rebuild switch --fast --flake ".#nixos" --use-remote-sudo --target-host "[email protected]" --build-host "[email protected]" --builders '"ssh://[email protected] aarch64-linux"'