mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 10:51:36 +01:00
Different Nix configurations for qs and prod
This commit is contained in:
17
.github/workflows/deploy.yml
vendored
17
.github/workflows/deploy.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Deploy app to server
|
||||
name: Deploy to server
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
@@ -7,12 +7,13 @@ on:
|
||||
branches: [ devel, main ]
|
||||
env:
|
||||
SERVER_USER: root
|
||||
SERVER_IP: 128.140.75.240
|
||||
QS_SERVER_IP: 128.140.75.240
|
||||
PROD_SERVER_IP: 128.140.75.240
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.event == 'push' }}
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.event != 'pull_request' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -24,14 +25,14 @@ jobs:
|
||||
- name: Install SSH Key
|
||||
uses: shimataro/ssh-key-action@v2
|
||||
with:
|
||||
key: ${{ secrets.DEMO_SERVER_SSH_KEY }}
|
||||
known_hosts: ${{ secrets.DEMO_SERVER_KNOWN_HOSTS }}
|
||||
key: ${{ github.ref_name == 'devel' && secrets.QS_SSH_KEY || secrets.PROD_SSH_KEY }}
|
||||
known_hosts: ${{ github.ref_name == 'devel' && secrets.QS_KNOWN_HOSTS || secrets.PROD_KNOWN_HOSTS }}
|
||||
|
||||
- name: Deploy to demo server
|
||||
run: |
|
||||
nix run nixpkgs#nixos-rebuild -- switch \
|
||||
--flake .#demo-server \
|
||||
--flake .#$[ github.ref_name == 'devel' && 'qs' || 'prod' ] \
|
||||
--fast \
|
||||
--build-host ${{ env.SERVER_USER }}@${{ env.SERVER_IP }} \
|
||||
--target-host ${{ env.SERVER_USER }}@${{ env.SERVER_IP }} \
|
||||
--build-host ${{ env.SERVER_USER }}@$[ github.ref_name == 'devel' && env.QS_SERVER_IP || env.PROD_SERVER_IP ] \
|
||||
--target-host ${{ env.SERVER_USER }}@$[ github.ref_name == 'devel' && env.QS_SERVER_IP || env.PROD_SERVER_IP ] \
|
||||
--use-remote-sudo
|
||||
|
||||
Reference in New Issue
Block a user