Skip to content

Commit

Permalink
feat: add testing framework
Browse files Browse the repository at this point in the history
  • Loading branch information
FinalAngel committed Apr 19, 2024
1 parent 459d6cd commit 141a800
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build template

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build docker image
run: docker-compose build

- name: Run docker container
run: docker-compose up -d

- name: Test if service is reachable
run: |
sleep 30
curl -s --retry 10 --retry-connrefused --insecure https://localhost:8000/
28 changes: 28 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy template

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install divio-cli
- name: Deploy to Divio
run: |
divio login ${{ secrets.DIVIO_TOKEN }}
divio app deploy test --remote-id ${{ secrets.DIVIO_WEBSITE_ID }}
- name: Test if website is reachable
run: |
curl -s --retry 10 --retry-connrefused ${{ secrets.WEBSITE_URL }}
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:
- ".:/app:rw"
- "node_modules:/app/node_modules"
command: npm run dev -- --host 0.0.0.0 --port 80
restart: always

volumes:
node_modules:

0 comments on commit 141a800

Please sign in to comment.