Skip to content

Merge pull request #13 from iFixit/cd #1

Merge pull request #13 from iFixit/cd

Merge pull request #13 from iFixit/cd #1

Workflow file for this run

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@v2
with:
role-to-assume: ${{ env.DEPLOY_IAM_ROLE }}
aws-region: us-east-1
- name: ECR login
uses: aws-actions/amazon-ecr-login@v1
- name: Push to ECR
run: docker push ${{ env.ECR_IMAGE_REPO }}:${{ github.sha }}