break Gitea actions up into separate files
This commit is contained in:
parent
2bef46ea1b
commit
26a4d142d7
@ -13,48 +13,6 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
checks: write
|
|
||||||
contents: write
|
|
||||||
steps:
|
|
||||||
- name: Login to Docker
|
|
||||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
|
||||||
with:
|
|
||||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
||||||
|
|
||||||
- name: Ruby Setup
|
|
||||||
uses: ruby/setup-ruby@dffc446db9ba5a0c4446edb5bca1c5c473a806c5 # v1.235.0
|
|
||||||
with:
|
|
||||||
ruby-version: '3.4'
|
|
||||||
bundler-cache: true
|
|
||||||
|
|
||||||
- run: bundle install
|
|
||||||
|
|
||||||
- name: Standard Ruby
|
|
||||||
run: bundle exec standardrb
|
|
||||||
|
|
||||||
|
|
||||||
test:
|
|
||||||
needs: lint
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
||||||
|
|
||||||
- name: Test
|
|
||||||
uses: ruby/setup-ruby@dffc446db9ba5a0c4446edb5bca1c5c473a806c5 # v1.235.0
|
|
||||||
with:
|
|
||||||
ruby-version: '3.4'
|
|
||||||
bundler-cache: true
|
|
||||||
|
|
||||||
- run: bundle exec rake
|
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
needs: test
|
needs: test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
23
.gitea/workflows/lint.yaml
Normal file
23
.gitea/workflows/lint.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
name: Ruby Lint
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
|
pull_request:
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
|
||||||
|
- name: Ruby Setup
|
||||||
|
uses: ruby/setup-ruby@dffc446db9ba5a0c4446edb5bca1c5c473a806c5 # v1.235.0
|
||||||
|
with:
|
||||||
|
ruby-version: '3.4'
|
||||||
|
bundler-cache: true
|
||||||
|
|
||||||
|
- name: Standard Ruby
|
||||||
|
run: bundle exec standardrb
|
||||||
|
|
112
.gitea/workflows/release.yaml
Normal file
112
.gitea/workflows/release.yaml
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
---
|
||||||
|
name: Gitea Actions Demo
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 10 * * *"
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
|
tags:
|
||||||
|
- "v*.*.*"
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
env:
|
||||||
|
DOCKER_ORG: ryanc
|
||||||
|
DOCKER_LATEST: latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
outputs:
|
||||||
|
metadata: ${{ steps.output.outputs.metadata }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # all history for all branches and tags
|
||||||
|
|
||||||
|
- name: Prepare
|
||||||
|
id: prep
|
||||||
|
run: |
|
||||||
|
VERSION="sha-${GITHUB_SHA::8}"
|
||||||
|
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
|
||||||
|
VERSION="${GITHUB_REF/refs\/tags\//}"
|
||||||
|
fi
|
||||||
|
printf "GITHUB_REF=%s\n" "$GITHUB_REF"
|
||||||
|
printf "GITHUB_SHA=%s\n" "$GITHUB_SHA"
|
||||||
|
printf "VERSION=%s\n" "$VERSION" | tee -a "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
|
||||||
|
|
||||||
|
- name: Login to Gitea registry
|
||||||
|
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
||||||
|
with:
|
||||||
|
registry: git.kill0.net
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Docker meta (debian)
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
git.kill0.net/ryanc/kubernaut
|
||||||
|
flavor: |
|
||||||
|
latest=auto
|
||||||
|
bake-target: docker-metadata-action
|
||||||
|
tags: |
|
||||||
|
type=schedule
|
||||||
|
type=ref,event=branch
|
||||||
|
type=ref,event=pr
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
type=sha
|
||||||
|
|
||||||
|
- name: Docker meta (alpine)
|
||||||
|
id: meta-alpine
|
||||||
|
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
git.kill0.net/ryanc/kubernaut
|
||||||
|
bake-target: docker-metadata-action-alpine
|
||||||
|
flavor: |
|
||||||
|
latest=auto
|
||||||
|
suffix=-alpine,onlatest=true
|
||||||
|
tags: |
|
||||||
|
type=schedule
|
||||||
|
type=ref,event=branch
|
||||||
|
type=ref,event=pr
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
type=sha
|
||||||
|
|
||||||
|
- name: Docker build and push
|
||||||
|
uses: docker/bake-action@76f9fa3a758507623da19f6092dc4089a7e61592 # v6.6.0
|
||||||
|
with:
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
files: |
|
||||||
|
./docker-bake.hcl
|
||||||
|
cwd://${{ steps.meta.outputs.bake-file }}
|
||||||
|
cwd://${{ steps.meta-alpine.outputs.bake-file }}
|
||||||
|
|
||||||
|
- name: Setup Helm
|
||||||
|
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
|
||||||
|
|
||||||
|
- name: Publish Helm chart
|
||||||
|
if: ${{ contains(github.ref, 'refs/tags/') }}
|
||||||
|
run: |
|
||||||
|
HELM_VERSION="${{ steps.prep.outputs.VERSION }}"
|
||||||
|
HELM_VERSION="${HELM_VERSION#v}"
|
||||||
|
helm package charts/kubernaut
|
||||||
|
helm push "kubernaut-${HELM_VERSION}.tgz" oci://git.kill0.net/ryanc/helm-charts
|
22
.gitea/workflows/test.yaml
Normal file
22
.gitea/workflows/test.yaml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
name: Ruby Test
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
|
pull_request:
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
uses: ruby/setup-ruby@dffc446db9ba5a0c4446edb5bca1c5c473a806c5 # v1.235.0
|
||||||
|
with:
|
||||||
|
ruby-version: '3.4'
|
||||||
|
bundler-cache: true
|
||||||
|
|
||||||
|
- run: bundle exec rake
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user