Skip to content

Merge pull request #39 from R-HNF/fix-issue38 #120

Merge pull request #39 from R-HNF/fix-issue38

Merge pull request #39 from R-HNF/fix-issue38 #120

Workflow file for this run

name: ci
on:
push:
branches:
- 'main'
tags:
- '*'
pull_request:
branches:
- 'main'
types: [opened, synchronize]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup tmate session to debug via SSH. See https://github.com/mxschmitt/action-tmate
# - uses: mxschmitt/action-tmate@v1
- uses: actions/setup-go@v2
with:
go-version: '1.16'
- name: Cache for Golang Packages
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- run: make test
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
config: .github/buildkitd.toml
- name: Build
uses: docker/build-push-action@v2
with:
context: .
push: false
load: true
tags: fluent-pvc-operator:development
cache-from: type=gha
cache-to: type=gha,mode=max
- run: make e2e/clean-test
build-n-push:
if: startsWith( github.ref, 'refs/tags/' )
needs:
- test
runs-on: ubuntu-latest
env:
CONTAINER_IMAGE_REPOSITORY: ghcr.io/${{ github.repository_owner }}/fluent-pvc-operator
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
config: .github/buildkitd.toml
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.CONTAINER_IMAGE_REPOSITORY }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=ref,event=tag
type=schedule,pattern={{date 'YYYYMMDD'}}
type=sha
- name: Build and Push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Get Tag Name
id: get_tag
run: |
echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}
- name: Create release YAML
run: |
make manifests-release IMG=$CONTAINER_IMAGE_REPOSITORY:${{ steps.get_tag.outputs.TAG }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.get_tag.outputs.TAG }}
draft: false
prerelease: false
generate_release_notes: true
files: fluent-pvc-operator.yaml