Ignore content of /hack in whitesource. #17
Workflow file for this run
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: 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: hack/e2e/sink | ||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: [ '*.*.*' ] | ||
paths: | ||
- 'hack/e2e/sink/**' | ||
- '.github/workflows/sink.yml' | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**.md' | ||
- 'sec-scanners-config.yaml' | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'hack/e2e/sink/**' | ||
- '.github/workflows/sink.yml' | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**.md' | ||
- 'sec-scanners-config.yaml' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
defaults: | ||
run: | ||
working-directory: ${{ env.E2E_SINK_DIR }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- 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@v3 | ||
# 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@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
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@v5 | ||
with: | ||
context: ${{ env.E2E_SINK_DIR }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
load: ${{ github.event_name == 'pull_request' }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |