-
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
1 parent
86877c4
commit 83ee8d8
Showing
2 changed files
with
36 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Update website | ||
|
||
on: | ||
workflow_dispatch: {} | ||
push: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip3 install websocket-client | ||
- name: Update site | ||
run: | | ||
python3 update.py {{ secrets.ION_CSRF_TOKEN }} {{ secrets.ION_SESSION_ID }} |
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,15 @@ | ||
from websocket import WebSocket | ||
import sys | ||
|
||
conn = WebSocket() | ||
conn.connect("wss://director.tjhsst.edu/sites/399/terminal/?", cookie=f"csrftoken={sys.argv[1]};sessionid={sys.argv[2]}") | ||
if 'true' not in conn.recv(): | ||
print("Could not connect") | ||
exit(1) | ||
|
||
conn.send_bytes(b'./update.sh\n') | ||
conn.recv() | ||
conn.recv() | ||
while '/site#' not in conn.recv().decode(): | ||
continue | ||
conn.close() |