Skip to content

Commit 563d28e

Browse files
committed
Add staging CI #589
Try on push Try develop #192 https setup docs try again add environments fix yml Try nested job try again Require secrets remote_host fix inputs Add remote host for production
1 parent 5aa187f commit 563d28e

File tree

5 files changed

+55
-11
lines changed

5 files changed

+55
-11
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Deployment Staging
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- 'master'
8+
jobs:
9+
deploy-staging:
10+
uses: './.github/workflows/deployment.yml'
11+
with:
12+
environment: production
13+
remote_host: atomicdata.dev
14+
secrets: inherit
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Deployment Staging
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- 'develop'
8+
jobs:
9+
deploy-staging:
10+
uses: './.github/workflows/deployment.yml'
11+
with:
12+
environment: staging
13+
remote_host: staging.atomicdata.dev
14+
secrets: inherit

.github/workflows/deployment.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
1-
name: Deployment
1+
name: Deployment (re-use)
22

33
on:
4-
workflow_dispatch:
4+
workflow_call:
5+
inputs:
6+
environment:
7+
required: true
8+
type: string
9+
remote_host:
10+
required: true
11+
type: string
12+
secrets:
13+
REMOTE_USER:
14+
required: true
15+
SSH_PRIVATE_KEY:
16+
required: true
517

618
jobs:
719
deploy:
20+
environment: ${{ inputs.environment }}
821
runs-on: ubuntu-latest
922
steps:
1023
- uses: actions/checkout@v2
@@ -25,13 +38,13 @@ jobs:
2538
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
2639
ARGS: "-rltgoDzvO"
2740
SOURCE: "target/x86_64-unknown-linux-musl/release/atomic-server"
28-
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
41+
REMOTE_HOST: ${{ inputs.remote_host }}
2942
REMOTE_USER: ${{ secrets.REMOTE_USER }}
3043
TARGET: ~/
3144
- name: executing remote ssh commands using ssh key
3245
uses: appleboy/ssh-action@master
3346
with:
34-
host: ${{ secrets.REMOTE_HOST }}
47+
host: ${{ inputs.remote_host }}
3548
username: ${{ secrets.REMOTE_USER }}
3649
key: ${{ secrets.SSH_PRIVATE_KEY }}
3750
script: |

server/default.env

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66
# domain name where the server is hosted, including subdoman, without schema (http) and port
77
# ATOMIC_DOMAIN=localhost
88

9+
# Port where it's running. Make sure you have the rights to run at this port.
10+
# Both an HTTPS and an HTTP port can be specified.
11+
12+
# Set this to 80 if you're running this publicly
13+
# ATOMIC_PORT=9883
14+
15+
# Set this to 443 if you're running this publicly
16+
# ATOMIC_PORT_HTTPS=9884
17+
918
# Whether you want to enable HTTPS. If set to true, the server will initialize Certification process on start using Let'sEncrypt. You'll need to set ATOMIC_EMAIL for this.
1019
# ATOMIC_HTTPS=false
1120

@@ -24,12 +33,6 @@
2433
# Path to where your config will be stored.
2534
# ATOMIC_CONFIG_FILE_PATH="/Users/your_home_folder/.config/atomic/config.toml"
2635

27-
# Port where it's running. Make sure you have the rights to run at this port.
28-
# Both an HTTPS and an HTTP port can be specified.
29-
# Both are necesssary during CERT_INIT
30-
# ATOMIC_PORT=9883
31-
# ATOMIC_PORT_HTTPS=9884
32-
3336
# Local IP where it's running. Use :: if you want it to be public.
3437
# ATOMIC_IP=::
3538

server/src/https.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ pub async fn cert_init_server(config: &crate::config::Config) -> AtomicServerRes
151151
request_cert(config)
152152
.await
153153
.map_err(|e| format!("Certification init failed: {}", e))?;
154-
tracing::warn!("HTTPS TLS Cert init sucesful! Stopping HTTP server, starting HTTPS...");
154+
tracing::warn!("HTTPS TLS Cert init successful! Stopping HTTP server, starting HTTPS...");
155155
handle.stop(true).await;
156156
Ok(())
157157
}

0 commit comments

Comments
 (0)