Update Dockerfile #18
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
name: Build and Push Docker Image to Harbor | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
environment: Monthome | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Display environment variables | |
run: | | |
echo "USER: $USER" | |
echo "URL: $URL" | |
env: | |
USER: ${{ vars.USER }} | |
URL: ${{ vars.URL }} | |
- name: Login to Container Registry | |
uses: docker/[email protected] | |
with: | |
registry: ${{ vars.URL }} | |
username: ${{ vars.USER }} | |
password: ${{ secrets.TOKEN }} | |
# - name: Build and push Docker image | |
# uses: docker/build-push-action@v4 | |
# with: | |
# context: . | |
# file: ./Dockerfile | |
# push: true | |
# tags: ${{ env.URL }}/utility/test:latest | |
- name: Build and push to Container Registry | |
uses: docker/[email protected] | |
with: | |
context: . | |
push: true | |
tags: ${{ vars.URL }}/utility/test:${{ github.sha }} | |
# - name: Build and push Docker image | |
# uses: docker/build-push-action@v4 | |
# with: | |
# context: . | |
# file: ./Dockerfile | |
# push: true | |
# tags: ${{ env.URL }}/utility/test:latest |