Skip to content

add Tag Docker image step #47

add Tag Docker image step

add Tag Docker image step #47

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 }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Tag Docker image
id: tag
uses: docker/metadata-action@v3
with:
tags: |

Check failure on line 59 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: 59, Col: 17): Unexpected symbol: '|'. Located at position 31 within expression: github.event.release.tag_name | split('.')[:2] | join('.')
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v${{ github.event.release.tag_name }}
type=semver,pattern=v${{ github.event.release.tag_name | split('.')[:2] | join('.') }}
images: ghcr.io/${{ github.repository }}${{ matrix.dir }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
file: "${{ matrix.dir }}/Dockerfile"
context: ${{ matrix.dir }}
platforms: linux/amd64
push: true
tags: ${{ steps.tag.outputs.tags }}