Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

chore: made publishable #3

chore: made publishable

chore: made publishable #3

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}

Check failure on line 15 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / CI/CD Pipeline

Invalid workflow file

The workflow is not valid. .github/workflows/main.yml (Line: 15, Col: 21): Unrecognized named-value: 'steps'. Located at position 1 within expression: steps.login-ecr.outputs.registry
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }}
IMAGE_TAG: ${{ github.sha }}
steps:
- name: Checkout code
uses: actions/checkout@v2
# - name: Set up JDK 17
# uses: actions/setup-java@v2
# with:
# java-version: '17'
# distribution: 'adopt'
#
# - name: Build with Gradle
# run: ./gradlew build
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: $AWS_ACCESS_KEY_ID
aws-secret-access-key: $AWS_SECRET_ACCESS_KEY
aws-region: $AWS_REGION
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build, tag, and push image to Amazon ECR
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
- name: Update App Runner image in AWS
run: |
echo $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
aws apprunner create-service --service-name benatty-shop-web-client --source-configuration '{"ImageRepository": {"ImageIdentifier": "'"$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"'", "ImageRepositoryType": "ECR"}}'