Skip to content

Change dockerfile path on build-push-action #51

Change dockerfile path on build-push-action

Change dockerfile path on build-push-action #51

Workflow file for this run

---
name: ci
on:
push:
branches: [ Workflows ]
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
args: --timeout 5m
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.20"
- run: go test -v ./... -covermode=atomic -coverprofile=coverage.out
- uses: codecov/codecov-action@v3
with:
files: coverage.out
build:
name: build
runs-on: ubuntu-latest
needs:
- lint
- test
strategy:
matrix:
dir: ["", "clients/proxy-client", "clients/harbor-client"]
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v3
id: meta
with:
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
images: ghcr.io/${{ github.repository }}${{ matrix.dir }}
- uses: docker/build-push-action@v2
with:
file: ${{ matrix.dir == "" && './Dockerfile' || matrix.dir + '/Dockerfile' }}

Check failure on line 64 in .github/workflows/ci.yaml

View workflow run for this annotation

GitHub Actions / ci

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yaml (Line: 64, Col: 17): Unexpected symbol: '""'. Located at position 15 within expression: matrix.dir == "" && './Dockerfile' || matrix.dir + '/Dockerfile'
context: ${{ matrix.dir }}
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}