Skip to content

Update docker-image.yml #8

Update docker-image.yml

Update docker-image.yml #8

Workflow file for this run

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 "HARBOR_USER: $HARBOR_USER"
echo "REPO_URL: $REPO_URL"
echo "USER: $USER"
echo "URL: $URL"
env:
HARBOR_USER: ${{ env.USER }}
REPO_URL: ${{ env.URL }}
USER: ${{ var.USER }}

Check failure on line 29 in .github/workflows/docker-image.yml

View workflow run for this annotation

GitHub Actions / Build and Push Docker Image to Harbor

Invalid workflow file

The workflow is not valid. .github/workflows/docker-image.yml (Line: 29, Col: 17): Unrecognized named-value: 'var'. Located at position 1 within expression: var.USER .github/workflows/docker-image.yml (Line: 30, Col: 16): Unrecognized named-value: 'var'. Located at position 1 within expression: var.URL
URL: ${{ var.URL }}
- name: Log in to Harbor
run: echo "${{ secrets.TOKEN }}" | docker login "${{ env.REPO_URL }}" -u "${{ env.HARBOR_USER }}" --password-stdin
env:
HARBOR_USER: ${{ env.USER }}
REPO_URL: ${{ env.URL }}
TOKEN: ${{ secrets.TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ env.REPO_URL }}/test:latest