Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Gani-23 authored Sep 3, 2024
1 parent c70eb6a commit 2ec8755
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: WaveNET Challenge

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
setup-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Check for merge conflicts
id: check-conflicts
run: |
! git ls-files -u | grep -q .
continue-on-error: true

- name: Fail on merge conflict
if: steps.check-conflicts.outcome == 'failure'
run: |
echo "Merge conflicts detected, failing the pipeline."
exit 1
- name: Set up Docker Environment
run: sudo chmod +x /var/run/docker.sock

- 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: ${{ secrets.AWS_REGION }}

- name: Login to Amazon ECR
run: |
aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username AWS --password-stdin ${{ secrets.ECR_REPO_URL }}
- name: Build Docker image
run: docker build . -t ${{ secrets.ECR_REPO_URL }}:${{ github.sha }}

- name: Push Docker image to Amazon ECR
run: docker push ${{ secrets.ECR_REPO_URL }}:${{ github.sha }}

0 comments on commit 2ec8755

Please sign in to comment.