Skip to content

Commit

Permalink
Add new pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
aiivashchenko committed Jan 27, 2022
1 parent 47f1c63 commit b307aaa
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 142 deletions.
112 changes: 112 additions & 0 deletions .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Main commit workflow

on:
push:
branches:
- main
tags:
- v*
paths-ignore:
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- '**.md'

env:
platforms: linux/amd64
registry: core.harbor.onmetal.de
image: core.harbor.onmetal.de/onmetal/ipam

jobs:
go-lint:
runs-on: [ self-hosted, Linux, X64 ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup golang
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Configure git for private modules
run: git config --global url."https://${{ secrets.GIT_USER }}:${{ secrets.GIT_PASSWORD }}@github.com".insteadOf "https://github.com"
- name: Lint golang sources
uses: golangci/golangci-lint-action@v2
with:
version: v1.42
args: -e S1008
go-test:
runs-on: [ self-hosted, Linux, X64 ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup golang
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Configure git for private modules
run: git config --global url."https://${{ secrets.GIT_USER }}:${{ secrets.GIT_PASSWORD }}@github.com".insteadOf "https://github.com"
- name: Run tests
run: make test
kustomize-test:
runs-on: [ self-hosted, Linux, X64 ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Complie manifests
uses: azure/k8s-bake@v1
with:
renderEngine: 'kustomize'
kustomizationPath: './config/default/'
kubectl-version: 'latest'
silent: 'false'
docker-build:
needs: [ kustomize-test, go-lint, go-test ]
runs-on: [ self-hosted, Linux, X64 ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get metadata for docker
uses: docker/metadata-action@v3
id: meta
with:
images: |
${{ env.image }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=semver,pattern={{version}}
type=sha
flavor: |
latest=${{ github.ref == 'refs/heads/main' }}
- name: Set up Docker Context for Buildx
id: buildx-context
run: |
docker context create builders
- name: Set up Docker Buildx
timeout-minutes: 5
uses: docker/setup-buildx-action@v1
with:
version: latest
endpoint: builders
- name: Login to Container Registry
uses: docker/login-action@v1
with:
registry: ${{ env.registry }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: ${{ env.platforms }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
GOPRIVATE=github.com/onmetal/*
GIT_USER=${{ secrets.GIT_USER }}
GIT_PASSWORD=${{ secrets.GIT_PASSWORD }}
49 changes: 0 additions & 49 deletions .github/workflows/docker.yaml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/helm.yaml

This file was deleted.

58 changes: 0 additions & 58 deletions .github/workflows/tests.yaml

This file was deleted.

0 comments on commit b307aaa

Please sign in to comment.