From 6f5e9e069036a5d7e2c63bc4c01dfcb68c189b44 Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Fri, 28 Mar 2025 19:38:34 +0530 Subject: [PATCH] feat: create yml file to push docker images Signed-off-by: Krishna Waske --- .../.github/workflows/continuous-delivery.yml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/.github/workflows/continuous-delivery.yml diff --git a/.github/workflows/.github/workflows/continuous-delivery.yml b/.github/workflows/.github/workflows/continuous-delivery.yml new file mode 100644 index 00000000..ffdc2e57 --- /dev/null +++ b/.github/workflows/.github/workflows/continuous-delivery.yml @@ -0,0 +1,44 @@ +name: Continous Delivery + +on: + push: + tags: + - 'v*' + +env: + REGISTRY: ghcr.io + SERVICE: credo-controller + +jobs: + build-and-push: + name: Push Docker image to GitHub + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Extract Git Tag + id: get_tag + run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and Push Docker Image ${{ env.SERVICE }} + uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile + push: true + tags: | + ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.SERVICE }}:${{ env.TAG }} + ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.SERVICE }}:latest