forked from Patrick-Davis-MSFT/chatbot-ui
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
17 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 |
---|---|---|
@@ -1,7 +1,5 @@ | ||
## | ||
name: Create and publish a Docker image | ||
|
||
# Configures this workflow to run every time a change is pushed to the branch 'main' or a tag is pushed. | ||
on: | ||
push: | ||
branches: | ||
|
@@ -30,18 +28,14 @@ jobs: | |
run: echo "IMAGE_NAME=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: https://ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Build and push the Docker image with two tags: one using the Git tag or SHA, and another using 'main'. | ||
- name: Build and push Docker image | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
ghcr.io/${{ env.IMAGE_NAME }}:${{ env.GIT_TAG }} | ||
ghcr.io/${{ env.IMAGE_NAME }}:main | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
|
||
# Build the Docker image | ||
- name: Build Docker image | ||
run: docker build -t ghcr.io/${{ env.IMAGE_NAME }}:${{ env.GIT_TAG }} -t ghcr.io/${{ env.IMAGE_NAME }}:main . | ||
|
||
# Push the Docker image to the registry | ||
- name: Push Docker image | ||
run: | | ||
docker push ghcr.io/${{ env.IMAGE_NAME }}:${{ env.GIT_TAG }} | ||
docker push ghcr.io/${{ env.IMAGE_NAME }}:main |