-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
154 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,43 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
release: | ||
types: | ||
- published | ||
workflow_dispatch: | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Lint and Format with Ruff | ||
run: | | ||
pip install ruff | ||
ruff check | ||
ruff format | ||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- check | ||
steps: | ||
- name: ZeroTier | ||
uses: zerotier/[email protected] | ||
with: | ||
network_id: ${{ secrets.ZEROTIER_NETWORK_ID }} | ||
auth_token: ${{ secrets.ZEROTIER_CENTRAL_TOKEN }} | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
|
@@ -20,6 +49,95 @@ jobs: | |
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
# TODO: Set SSH config | ||
# TODO: Acquire known_hosts from each config | ||
# TODO: Execute the `setup.py` file | ||
- name: Register Hibonite SSH key | ||
uses: shimataro/ssh-key-action@v2 | ||
with: | ||
key: ${{ secrets.HIBONITE_SSH_KEY }} | ||
name: id_hibonite | ||
known_hosts: ${{ secrets.HIBONITE_KNOWN_HOSTS }} | ||
if_key_exists: replace | ||
config: | | ||
Host hibonite.gems.teknologiumum.com | ||
HostName hibonite.gems.teknologiumum.com | ||
User ${{ secrets.HIBONITE_SSH_USER }} | ||
Port ${{ secrets.HIBONITE_SSH_PORT }} | ||
IdentityFile ~/.ssh/id_hibonite | ||
ServerAliveInterval 15 | ||
- name: Register Tanzanite SSH key | ||
uses: shimataro/ssh-key-action@v2 | ||
with: | ||
key: ${{ secrets.TANZANITE_SSH_KEY }} | ||
name: id_tanzanite | ||
known_hosts: ${{ secrets.TANZANITE_KNOWN_HOSTS }} | ||
if_key_exists: replace | ||
config: | | ||
Host tanzanite.gems.teknologiumum.com | ||
HostName tanzanite.gems.teknologiumum.com | ||
User ${{ secrets.TANZANITE_SSH_USER }} | ||
Port ${{ secrets.TANZANITE_SSH_PORT }} | ||
IdentityFile ~/.ssh/id_tanzanite | ||
ServerAliveInterval 15 | ||
- name: Register Painite SSH key | ||
uses: shimataro/ssh-key-action@v2 | ||
with: | ||
key: ${{ secrets.PAINITE_SSH_KEY }} | ||
name: id_painite | ||
known_hosts: ${{ secrets.PAINITE_KNOWN_HOSTS }} | ||
if_key_exists: replace | ||
config: | | ||
Host painite.gems.teknologiumum.com | ||
HostName painite.gems.teknologiumum.com | ||
User ${{ secrets.PAINITE_SSH_USER }} | ||
Port ${{ secrets.PAINITE_SSH_PORT }} | ||
IdentityFile ~/.ssh/id_painite | ||
ServerAliveInterval 15 | ||
- name: Ping Hibonite Host | ||
shell: bash | ||
run: | | ||
count=120 # 2 minutes | ||
while ! ping -c 1 hibonite.gems.teknologiumum.com ; do | ||
echo "waiting..." ; | ||
sleep 1 ; | ||
let count=count-1 | ||
done | ||
if [ $count -eq 0 ]; then | ||
echo "Failed to ping hibonite.gems.teknologiumum.com" | ||
exit 1 | ||
fi | ||
- name: Ping Tanzanite Host | ||
shell: bash | ||
run: | | ||
count=120 # 2 minutes | ||
while ! ping -c 1 tanzanite.gems.teknologiumum.com ; do | ||
echo "waiting..." ; | ||
sleep 1 ; | ||
let count=count-1 | ||
done | ||
if [ $count -eq 0 ]; then | ||
echo "Failed to ping tanzanite.gems.teknologiumum.com" | ||
exit 1 | ||
fi | ||
- name: Ping Painite Host | ||
shell: bash | ||
run: | | ||
count=120 # 2 minutes | ||
while ! ping -c 1 painite.gems.teknologiumum.com ; do | ||
echo "waiting..." ; | ||
sleep 1 ; | ||
let count=count-1 | ||
done | ||
if [ $count -eq 0 ]; then | ||
echo "Failed to ping painite.gems.teknologiumum.com" | ||
exit 1 | ||
fi | ||
- name: Execute setup file | ||
run: python3 ./setup.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,8 @@ services: | |
|
||
volumes: | ||
polarite-data: | ||
|
||
external: true | ||
|
||
networks: | ||
public-web: | ||
external: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
docker volume create polarite-data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters