2023-03-18 16:41:16 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
name: test-and-build
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: ['*']
|
|
|
|
tags: ['v*']
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test-and-build:
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
container:
|
2024-04-16 11:09:55 +00:00
|
|
|
image: luzifer/gh-arch-env
|
2023-03-18 16:41:16 +00:00
|
|
|
env:
|
2024-04-16 11:14:56 +00:00
|
|
|
CGO_ENABLED: 0
|
2023-03-18 16:41:16 +00:00
|
|
|
GOPATH: /go
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2024-04-16 11:09:55 +00:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
show-progress: false
|
2023-03-18 16:41:16 +00:00
|
|
|
|
|
|
|
- name: Marking workdir safe
|
|
|
|
run: git config --global --add safe.directory /__w/go-latestver/go-latestver
|
|
|
|
|
|
|
|
- name: Lint and test code
|
|
|
|
run: |
|
2024-04-16 15:45:45 +00:00
|
|
|
make go_test helm_lint
|
|
|
|
|
|
|
|
helm-publish:
|
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
|
|
|
|
|
|
needs:
|
|
|
|
- test-and-build
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
container:
|
|
|
|
image: luzifer/gh-arch-env
|
|
|
|
env:
|
|
|
|
CGO_ENABLED: 0
|
|
|
|
GOPATH: /go
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
packages: write
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
show-progress: false
|
|
|
|
|
|
|
|
- name: Log into registry
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Package Helm Chart
|
|
|
|
run: |
|
|
|
|
helm package charts/latestver
|
|
|
|
helm push latestver-*.tgz oci://ghcr.io/luzifer
|
2023-03-18 16:41:16 +00:00
|
|
|
|
2024-04-16 11:09:55 +00:00
|
|
|
docker-publish:
|
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master' }}
|
|
|
|
|
|
|
|
needs:
|
|
|
|
- test-and-build
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
packages: write
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
show-progress: false
|
|
|
|
|
|
|
|
- name: Log into registry
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Docker Build & Publish
|
|
|
|
run: bash ci/docker-publish.sh
|
|
|
|
|
2023-03-18 16:41:16 +00:00
|
|
|
...
|