mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 02:41:35 +01:00
Update deploy action to not trigger on pull requests
This commit is contained in:
39
.github/workflows/deploy.yml
vendored
Normal file
39
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: Deploy app to server
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [ 'Playwright tests' ]
|
||||
types: [ completed ]
|
||||
branches: [ devel, main ]
|
||||
env:
|
||||
SERVER_USER: root
|
||||
SERVER_IP: 128.140.75.240
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
if: |
|
||||
github.event.workflow_run.conclusion == 'success' &&
|
||||
github.event.workflow_run.event == 'push'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v27
|
||||
with:
|
||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install SSH Key
|
||||
uses: shimataro/ssh-key-action@v2
|
||||
with:
|
||||
key: ${{ secrets.DEMO_SERVER_SSH_KEY }}
|
||||
known_hosts: ${{ secrets.DEMO_SERVER_KNOWN_HOSTS }}
|
||||
|
||||
- name: Deploy to demo server
|
||||
run: |
|
||||
nix run nixpkgs#nixos-rebuild -- switch \
|
||||
--flake .#demo-server \
|
||||
--fast \
|
||||
--build-host ${{ env.SERVER_USER }}@${{ env.SERVER_IP }} \
|
||||
--target-host ${{ env.SERVER_USER }}@${{ env.SERVER_IP }} \
|
||||
--use-remote-sudo
|
||||
Reference in New Issue
Block a user