diff --git a/.github/workflows/demo-server-deploy.yml b/.github/workflows/deploy.yml similarity index 83% rename from .github/workflows/demo-server-deploy.yml rename to .github/workflows/deploy.yml index 1d79a3d..55601af 100644 --- a/.github/workflows/demo-server-deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,9 +1,10 @@ -name: Deploy app to demo server (demo.archtika.com) +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 @@ -11,7 +12,9 @@ env: jobs: deploy: runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} + if: | + github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.event == 'push' steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/playwright.yml b/.github/workflows/test.yml similarity index 95% rename from .github/workflows/playwright.yml rename to .github/workflows/test.yml index a110f8e..0e2c6fe 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/test.yml @@ -2,9 +2,9 @@ name: Playwright tests on: push: - branches: [ main ] + branches: [ devel, main ] pull_request: - branches: [ main ] + branches: [ devel, main ] jobs: test: diff --git a/flake.nix b/flake.nix index 741ef17..b098b72 100644 --- a/flake.nix +++ b/flake.nix @@ -61,7 +61,7 @@ api = { type = "app"; program = "${pkgs.writeShellScriptBin "api-setup" '' - JWT_SECRET=$(head -c 64 /dev/urandom | base64 | tr -d '/+=' | head -c 64) + JWT_SECRET=$(tr -dc 'A-Za-z0-9' < /dev/urandom | head -c64) ${pkgs.postgresql_16}/bin/psql postgres://postgres@localhost:15432/archtika -c "ALTER DATABASE archtika SET \"app.jwt_secret\" TO '$JWT_SECRET'" diff --git a/nix/module.nix b/nix/module.nix index c9f5611..123a60e 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -102,7 +102,7 @@ in }; script = '' - JWT_SECRET=$(head -c 64 /dev/urandom | base64 | tr -d '/+=' | head -c 64) + JWT_SECRET=$(tr -dc 'A-Za-z0-9' < /dev/urandom | head -c64) ${pkgs.postgresql_16}/bin/psql postgres://postgres@localhost:5432/${cfg.databaseName} -c "ALTER DATABASE ${cfg.databaseName} SET \"app.jwt_secret\" TO '$JWT_SECRET'"