Skip to content

E2E Tests Sink

E2E Tests Sink #46

Workflow file for this run

name: E2E Tests Sink
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}/e2e-tests-sink
E2E_SINK_DIR: e2e/sink
on:
push:
branches:
- main
tags: [ '*.*.*' ]
paths:
- 'e2e/sink/**'
- .github/workflows/sink.yml
pull_request:
branches:
- main
paths:
- 'e2e/sink/**'
- .github/workflows/sink.yml
jobs:
build:
runs-on: ubuntu-latest
permissions: write-all
defaults:
run:
working-directory: ${{ env.E2E_SINK_DIR }}
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19
cache: true
- name: Build
run: go build -v ./...
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
# if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha
type=semver,pattern={{version}},event=tag
labels: |
org.opencontainers.image.title=E2E Tests Sink
org.opencontainers.image.description=A webserver imitating an eventing sink that receives events and stores in memory
org.opencontainers.image.url=https://github.com/kyma-project/eventing-manager/${{ env.E2E_SINK_DIR }}
- name: Build Docker image
id: build-and-push
uses: docker/build-push-action@v4
with:
context: ${{ env.E2E_SINK_DIR }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max