-
Notifications
You must be signed in to change notification settings - Fork 3
33 lines (31 loc) · 1.74 KB
/
automated-deployment-dev.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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 }}