Skip to content

Fix: handle rate limit and directory creation #17

Fix: handle rate limit and directory creation

Fix: handle rate limit and directory creation #17

name: Dev Deployment
on:
push:
branches:
- develop
- feature/automate_scraper
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-2
- name: Build and push container image
run: |
aws ecr get-login-password | docker login --username AWS --password-stdin ${{ secrets.SCRAPER_ECR_ENDPOINT }}
docker build -f Dockerfile -t ${{ secrets.SCRAPER_ECR_REPO_ID_DEV }}:${{ github.sha }} .
docker tag ${{ secrets.SCRAPER_ECR_REPO_ID_DEV }}:${{ github.sha }} ${{ secrets.SCRAPER_ECR_ENDPOINT }}/${{ secrets.SCRAPER_ECR_REPO_ID_DEV }}:${{ github.sha }}
docker push ${{ secrets.SCRAPER_ECR_ENDPOINT }}/${{ secrets.SCRAPER_ECR_REPO_ID_DEV }}:${{ github.sha }}
- name: Deploy infrastructure
run: |
aws cloudformation deploy --template-file infra/template.yaml --stack-name "caddy-scraper-dev" --no-fail-on-empty-changeset --capabilities CAPABILITY_NAMED_IAM --parameter-overrides StageName=dev CaddyScraperImage=${{ secrets.SCRAPER_ECR_ENDPOINT }}/${{ secrets.SCRAPER_ECR_REPO_ID_DEV }}:${{ github.sha }} OpensearchUrl=${{ secrets.OPENSEARCH_DEV_URL }} OpensearchIndex=${{ vars.OPENSEARCH_INDEX }} AdvisernetSecretArn=${{ secrets.ADVISERNET_SECRET_ARN }} CaddyPrivateSubnetId=${{ secrets.CADDY_PRIVATE_SUBNET_DEV }} CaddyVpcId=${{ secrets.CADDY_VPC_SUBNET_DEV }}