Skip to content

Commit

Permalink
deploy workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
witoldnowogorski committed Mar 24, 2024
1 parent 21b9fc9 commit c43aa9d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
27 changes: 26 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,30 @@ on:
- prod

jobs:
deploy:
build-and-deploy:
name: run docker container on gc
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build Docker Container
run: |
docker buildx build --platform linux/amd64 -t chat-agh .
- name: Tag Docker Container
run: |
docker tag chat-agh europe-west4-docker.pkg.dev/chat-agh-417420/docker-repository/chat-agh
- name: Push Docker Container
run: |
docker push europe-west4-docker.pkg.dev/chat-agh-417420/docker-repository/chat-agh
- name: Terraform Apply
working-directory: infra
run: |
source .env && terraform apply --auto-approve
17 changes: 15 additions & 2 deletions src/sources/urls_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,28 @@ def get_pages_from_sitemap(domain):
'https://wh.agh.edu.pl',
'https://www.sjo.agh.edu.pl',
'https://www.swfis.agh.edu.pl',
'https://sylabusy.agh.edu.pl'
'https://sylabusy.agh.edu.pl',
'https://sylabusy.agh.edu.pl/pl/'
'https://skn.agh.edu.pl',
'https://dss.agh.edu.pl',
'https://akademik.agh.edu.pl'
]

def format_link(link: str):
return link.split('#')[0]

def filter(page):
for year in range(16, 22):
if f'20{str(year)}' in page:
return True
if len(page) > 110:
return True

return False

pages = []
for domain in domains:
new_links = [format_link(page) for page in get_pages_from_sitemap(domain)]
new_links = [format_link(page) for page in get_pages_from_sitemap(domain) if not filter(page)]
pages.extend(new_links)
print(f"{len(new_links)} url's found in domain {domain}")

Expand Down

0 comments on commit c43aa9d

Please sign in to comment.