diff --git a/.github/workflows/Unit-Tests.yml b/.github/workflows/Unit-Tests.yml new file mode 100644 index 0000000..b9633a1 --- /dev/null +++ b/.github/workflows/Unit-Tests.yml @@ -0,0 +1,30 @@ +name: Run Blackboard Session Tests + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install backend dependencies + run: | + python -m pip install --upgrade pip + pip install -r backend/requirements.txt + + - name: Run tests + run: | + python backend/test_blackboard_scraper.py diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index c1b60ed..cb56431 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -5,25 +5,35 @@ on: branches: [ "main" ] pull_request: branches: [ "main" ] + release: + types: [published] jobs: backend-build: - runs-on: ubuntu-latest - steps: - name: Checkout backend code uses: actions/checkout@v3 - - name: Build the Docker image for backend - run: docker build ./backend -t backend-image-name:$(date +%s) + + - name: Build and push the Docker image for backend + run: | + TIMESTAMP=$(date +%s) + docker build ./backend -t themanwholikestocode/archive-me-prod:backend-$TIMESTAMP + docker tag themanwholikestocode/archive-me-prod:backend-$TIMESTAMP domain.com/repo/tag_docker_name:latest + echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin + docker push themanwholikestocode/archive-me-prod:backend-$TIMESTAMP frontend-build: - runs-on: ubuntu-latest - steps: - name: Checkout frontend code uses: actions/checkout@v3 - - name: Build the Docker image for frontend - run: docker build ./frontend -t frontend-image-name:$(date +%s) + + - name: Build and push the Docker image for frontend + run: | + TIMESTAMP=$(date +%s) + docker build ./frontend -t themanwholikestocode/archive-me-prod:frontend-$TIMESTAMP + docker tag themanwholikestocode/archive-me-prod:frontend-$TIMESTAMP domain.com/repo/tag_docker_name:latest + echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin + docker push themanwholikestocode/archive-me-prod:frontend-$TIMESTAMP diff --git a/README.md b/README.md index abf590c..a79c613 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# Blackboard Scraper +# Archive-Me Archive Me is a tool for students to easily archive and track their course materials on Blackboard. It helps students store and organize their coursework for long-term access and reference. This tool is useful for college students to preserve their academic records. diff --git a/backend/requirements.txt b/backend/requirements.txt index cd7607b..d5177b0 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -6,4 +6,4 @@ bs4 gunicorn flask_cors flask_apscheduler -pydrive2 \ No newline at end of file +pydrive2