Skip to content

Commit

Permalink
chore: add container registry workflow (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
devalpatel67 authored Feb 11, 2025
1 parent 9569a60 commit 525129e
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow is used to build the image for the provider build service

name: Build Image

# This workflow is triggered when a release is created
on:
release:
types: [released]

workflow_dispatch:

env:
IMAGE_TAG: ${{ github.event.release.tag_name }}

jobs:
build:
name: Build Docker image
runs-on: ubuntu-latest

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

- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Build, tag, and push image to GitHub Container Registry
env:
IMAGE_NAME: ghcr.io/${{ github.repository }}
run: |
docker build -t $IMAGE_NAME:$IMAGE_TAG .
docker push $IMAGE_NAME:$IMAGE_TAG
- name: Log out of GitHub Container Registry
if: always()
run: docker logout ghcr.io

0 comments on commit 525129e

Please sign in to comment.