-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add container registry workflow (#7)
- Loading branch information
1 parent
9569a60
commit 525129e
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |