Skip to content

buildspec.yml

buildspec.yml #14

Workflow file for this run

name: deploy
on:
push:
branches:
- main
paths-ignore:
- '**.md'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install & Build
uses: actions/checkout@v2
- run: yarn install --frozen-lockfile
- run: yarn build && yarn install --production --ignore-scripts --prefer-offline
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: 600453241670.dkr.ecr.us-east-1.amazonaws.com
ECR_REPOSITORY: next-docker
IMAGE_TAG: latest
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"