Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): build & push action #2

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/build-n-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and push the image to ECR

on:
workflow_dispatch:
inputs:
tag:
description: 'Tag for the image'
required: true
default: 'latest'

jobs:
build-and-push:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
timeout-minutes: 5

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a
timeout-minutes: 5
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1

- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076
timeout-minutes: 5

- name: Build and push the image
timeout-minutes: 5
env:
REPO_URL: 698591829921.dkr.ecr.eu-central-1.amazonaws.com/tsbs
IMAGE_TAG: ${{ github.event.inputs.tag }}
run: |
docker build -t $REPO_URL:$IMAGE_TAG .
docker push $REPO_URL:$IMAGE_TAG
Loading