-
Notifications
You must be signed in to change notification settings - Fork 2
37 lines (29 loc) · 1.08 KB
/
deploy.yml
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
34
35
36
37
name: Shopify Analytics Deploy
permissions:
id-token: write # Required to allow the JWT to be requested from GitHub's OIDC provider
contents: read # Required for actions/checkout
on:
push:
branches: [ master ]
# Allow running this workflow manually from the Actions tab
workflow_dispatch:
env:
ECR_IMAGE_REPO: "884681002735.dkr.ecr.us-east-1.amazonaws.com/shopify-analytics"
DEPLOY_IAM_ROLE: "arn:aws:iam::884681002735:role/github_actions/github-actions-role"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build Image
run: docker build -t ${{ env.ECR_IMAGE_REPO }}:${{ github.sha }} --label org.label-schema.name="shopify-analytics" .
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.DEPLOY_IAM_ROLE }}
aws-region: us-east-1
- name: ECR login
uses: aws-actions/amazon-ecr-login@v2
- name: Push to ECR
run: docker push ${{ env.ECR_IMAGE_REPO }}:${{ github.sha }}