Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👷 ci: add skaffold build ci action #41

Merged
merged 3 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build on PR
on:
pull_request:
paths:
- src/**
- k8s-manifests
- .github/workflows/build-images.yaml
jobs:
build:
name: Skaffold Build
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Cache layers
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/.skaffold/cache"
key: skaffold-${{ hashFiles('**/cache') }}
restore-keys: |
skaffold-

- name: Run Skaffold build pipeline
uses: hiberbee/[email protected]
id: build
with:
command: build
skip-tests: true
push: false
55 changes: 55 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Publish images
on:
push:
branches:
- main
- 'release/**'
jobs:
build:
name: Publish on container registry
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Get release version
if: startsWith(github.ref_name, 'release')
uses: actions-ecosystem/action-regex-match@v2
id: release-version
with:
text: ${{ github.ref_name }}
regex: '^release\/(.*)$'

- name: Set image tag
run: |
echo "IMAGE_TAG=${{ github.sha }}" >> $GITHUB_ENV

- name: Set image release tag
if: ${{ steps.release-version.outputs.match != '' }}
run: |
echo "IMAGE_TAG=${{ steps.release-version.outputs.group1 }}" >> $GITHUB_ENV

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ vars.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Cache layers
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/.skaffold/cache"
key: skaffold-${{ hashFiles('**/cache') }}
restore-keys: |
skaffold-

- name: Run Skaffold build pipeline
uses: hiberbee/[email protected]
id: build
with:
command: build
skip-tests: true
tag: ${{ env.IMAGE_TAG }}
repository: ${{ vars.REGISTRY }}/${{ github.repository }}
push: true