Skip to content

Commit 042c838

Browse files
authored
Merge pull request #150 from AndrewCS149/dockerize
Dockerize
2 parents 252850f + 96123ca commit 042c838

File tree

195 files changed

+5455
-37784
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+5455
-37784
lines changed

.github/workflows/Build.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/Publish.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/staging.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Deploy to Staging
2+
3+
on:
4+
push:
5+
branches:
6+
- staging
7+
8+
jobs:
9+
deploy-to-staging:
10+
name: Deploy to Staging
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Cache Trunk
14+
uses: actions/cache@v3
15+
with:
16+
path: ~/.cargo
17+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
18+
restore-keys: |
19+
${{ runner.os }}-cargo-
20+
21+
- uses: actions/checkout@v3
22+
- name: Set up Rust
23+
uses: dtolnay/rust-toolchain@stable
24+
with:
25+
targets: wasm32-unknown-unknown
26+
toolchain: stable
27+
28+
- name: Install Trunk
29+
run: cargo install trunk
30+
if: steps.cache.outputs.cache-hit != 'true'
31+
32+
- name: Build with Trunk
33+
run: trunk build --release
34+
working-directory: client
35+
36+
- name: Create SSH Key
37+
run: |
38+
mkdir -p ${{ secrets.SSH_PRIVATE_KEY_PATH }}
39+
echo "${{ secrets.SSH_PRIVATE_KEY_CONTENT }}" > ${{ secrets.SSH_PRIVATE_KEY_PATH }}/${{ secrets.SSH_PRIVATE_KEY_NAME }}
40+
sudo chmod 600 ${{ secrets.SSH_PRIVATE_KEY_PATH }}/${{ secrets.SSH_PRIVATE_KEY_NAME }}
41+
shell: bash
42+
43+
- name: Create Project Folders
44+
run: |
45+
ssh -i ${{ secrets.SSH_PRIVATE_KEY_PATH }}/${{ secrets.SSH_PRIVATE_KEY_NAME }} ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} \
46+
mkdir -p ${{ secrets.DEVBLOG_STAGING_ROOT_PATH }}/client; \
47+
mkdir -p ${{ secrets.DEVBLOG_STAGING_ROOT_PATH }}/server;
48+
49+
- name: Copy Files to Server
50+
uses: appleboy/scp-action@master
51+
with:
52+
host: ${{ secrets.SSH_HOST }}
53+
username: ${{ secrets.SSH_USER }}
54+
key: ${{ secrets.SSH_PRIVATE_KEY_CONTENT }}
55+
source: "client/dist"
56+
target: "${{ secrets.DEVBLOG_STAGING_ROOT_PATH }}/client"
57+
58+
- name: Restart Container
59+
run: |
60+
ssh -i ${{ secrets.SSH_PRIVATE_KEY_PATH }}/${{ secrets.SSH_PRIVATE_KEY_NAME }} ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} \
61+
cd ${{ secrets.DEVBLOG_STAGING_ROOT_PATH }}/../;
62+
docker container rm -f ${{ secrets.DEVBLOG_STAGING_CONTAINER_NAME }}; \
63+
docker compose up -d;
64+
65+

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
.env
66
Dockerfile
77

8+
# rust
9+
/target
10+
/client/target
11+
/client/dist
12+
/lib/target
13+
/lib/Cargo.lock
14+
815
# User-specific files
916
*.rsuser
1017
*.suo

0 commit comments

Comments
 (0)