-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from banzaicloud/move-to-gha
ci: move workflows to github actions
- Loading branch information
Showing
6 changed files
with
156 additions
and
63 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: "docker" | ||
directory: "/" | ||
labels: | ||
- "dependencies" | ||
schedule: | ||
interval: "daily" | ||
|
||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
labels: | ||
- "dependencies" | ||
schedule: | ||
interval: "daily" | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
labels: | ||
- "dependencies" | ||
schedule: | ||
interval: "daily" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.18 | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Download license information for dependencies | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: make license-cache | ||
|
||
- name: Check licenses | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: make license-check | ||
|
||
- name: Run checks | ||
run: | | ||
make check |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Docker | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- "[0-9]+.[0-9]+.[0-9]+" | ||
- "[0-9]+.[0-9]+.[0-9]+-dev.[0-9]+" | ||
- "[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+" | ||
- "[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+" | ||
- "[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+" | ||
|
||
env: | ||
PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7 | ||
|
||
jobs: | ||
docker: | ||
name: Docker | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.ref }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.CR_PAT }} | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Determine tag or commit | ||
uses: haya14busa/action-cond@v1 | ||
id: refortag | ||
with: | ||
cond: ${{ startsWith(github.ref, 'refs/tags/') }} | ||
if_true: ${{ github.ref }} | ||
if_false: latest | ||
|
||
- name: Determine image tag | ||
id: imagetag | ||
run: echo "::set-output name=value::${TAG_OR_BRANCH##*/}" | ||
env: | ||
TAG_OR_BRANCH: ${{ steps.refortag.outputs.value }} | ||
|
||
- name: Build allspark | ||
uses: docker/build-push-action@v3 | ||
with: | ||
file: Dockerfile | ||
platforms: linux/amd64 | ||
push: true | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
tags: | | ||
ghcr.io/banzaicloud/allspark:${{ steps.imagetag.outputs.value }} | ||
banzaicloud/allspark:${{ steps.imagetag.outputs.value }} |
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
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