patch: migrate to gitea actions (#14)
Some checks failed
Push / release-docker-helm (push) Failing after 2s
Some checks failed
Push / release-docker-helm (push) Failing after 2s
Co-authored-by: Madison Grubb <madison@elastiflow.com> Reviewed-on: #14
This commit was merged in pull request #14.
This commit is contained in:
85
.gitea/workflows/pr.yml
Normal file
85
.gitea/workflows/pr.yml
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
name: PR
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v6
|
||||||
|
with:
|
||||||
|
node-version: "24"
|
||||||
|
cache: "npm"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run lint
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v6
|
||||||
|
with:
|
||||||
|
node-version: "24"
|
||||||
|
cache: "npm"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: npm run test
|
||||||
|
|
||||||
|
e2e:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: mcr.microsoft.com/playwright:v1.58.2-noble
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v6
|
||||||
|
with:
|
||||||
|
node-version: "24"
|
||||||
|
cache: "npm"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Generate dev cert
|
||||||
|
run: ./scripts/gen-dev-cert.sh
|
||||||
|
|
||||||
|
- name: Run e2e tests
|
||||||
|
run: npm run test:e2e
|
||||||
|
env:
|
||||||
|
NODE_TLS_REJECT_UNAUTHORIZED: "0"
|
||||||
|
|
||||||
|
docker-build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Set Docker image tag
|
||||||
|
id: image
|
||||||
|
run: |
|
||||||
|
REGISTRY="${GITHUB_SERVER_URL#https://}"
|
||||||
|
REGISTRY="${REGISTRY#http://}"
|
||||||
|
echo "tag=${REGISTRY}/${{ github.repository }}:latest" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Build (dry run)
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: false
|
||||||
|
tags: ${{ steps.image.outputs.tag }}
|
||||||
59
.gitea/workflows/push.yml
Normal file
59
.gitea/workflows/push.yml
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
name: Push
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release-docker-helm:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITEA_REPO_TOKEN }}
|
||||||
|
|
||||||
|
- name: Release (bump, tag, push, create release)
|
||||||
|
env:
|
||||||
|
CI_REPO_OWNER: ${{ github.actor }}
|
||||||
|
CI_REPO_NAME: ${{ github.event.repository.name }}
|
||||||
|
CI_FORGE_URL: ${{ github.server_url }}
|
||||||
|
CI_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
||||||
|
GITEA_REPO_TOKEN: ${{ secrets.GITEA_REPO_TOKEN }}
|
||||||
|
run: |
|
||||||
|
sudo apt-get update -qq && sudo apt-get install -y -qq git wget
|
||||||
|
./scripts/release.sh
|
||||||
|
|
||||||
|
- name: Log in to container registry
|
||||||
|
run: |
|
||||||
|
REGISTRY="${GITHUB_SERVER_URL#https://}"
|
||||||
|
echo "${{ secrets.GITEA_REGISTRY_TOKEN }}" | docker login "$REGISTRY" -u "${{ github.actor }}" --password-stdin
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Build Docker image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
load: true
|
||||||
|
tags: kestrelos:built
|
||||||
|
|
||||||
|
- name: Push Docker image (all tags from .tags)
|
||||||
|
run: |
|
||||||
|
REGISTRY="${GITHUB_SERVER_URL#https://}"
|
||||||
|
IMAGE="$REGISTRY/${{ github.repository }}"
|
||||||
|
while read -r tag; do
|
||||||
|
docker tag kestrelos:built "$IMAGE:$tag"
|
||||||
|
docker push "$IMAGE:$tag"
|
||||||
|
done < .tags
|
||||||
|
|
||||||
|
- name: Package and push Helm chart
|
||||||
|
env:
|
||||||
|
GITEA_REGISTRY_TOKEN: ${{ secrets.GITEA_REGISTRY_TOKEN }}
|
||||||
|
run: |
|
||||||
|
curl -sSfL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
||||||
|
helm package helm/kestrelos
|
||||||
|
for f in kestrelos-*.tgz; do
|
||||||
|
curl -sf -u "${{ github.actor }}:$GITEA_REGISTRY_TOKEN" -X POST --upload-file "$f" \
|
||||||
|
"${{ github.server_url }}/api/packages/${{ github.actor }}/helm/api/charts"
|
||||||
|
done
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
when:
|
|
||||||
- event: pull_request
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: install
|
|
||||||
image: node:24-slim
|
|
||||||
depends_on: []
|
|
||||||
commands:
|
|
||||||
- npm ci
|
|
||||||
|
|
||||||
- name: lint
|
|
||||||
image: node:24-slim
|
|
||||||
depends_on: [install]
|
|
||||||
commands:
|
|
||||||
- npm run lint
|
|
||||||
|
|
||||||
- name: test
|
|
||||||
image: node:24-slim
|
|
||||||
depends_on: [install]
|
|
||||||
commands:
|
|
||||||
- npm run test
|
|
||||||
|
|
||||||
- name: e2e
|
|
||||||
image: mcr.microsoft.com/playwright:v1.58.2-noble
|
|
||||||
depends_on: [install]
|
|
||||||
commands:
|
|
||||||
- ./scripts/gen-dev-cert.sh
|
|
||||||
- npm run test:e2e
|
|
||||||
environment:
|
|
||||||
NODE_TLS_REJECT_UNAUTHORIZED: "0"
|
|
||||||
|
|
||||||
- name: docker-build
|
|
||||||
image: woodpeckerci/plugin-kaniko
|
|
||||||
depends_on: []
|
|
||||||
settings:
|
|
||||||
repo: ${CI_REPO_OWNER}/${CI_REPO_NAME}
|
|
||||||
registry: git.keligrubb.com
|
|
||||||
tags: latest
|
|
||||||
dry-run: true
|
|
||||||
single-snapshot: true
|
|
||||||
cleanup: true
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
when:
|
|
||||||
- event: push
|
|
||||||
branch: main
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: release
|
|
||||||
image: alpine
|
|
||||||
commands:
|
|
||||||
- apk add --no-cache git
|
|
||||||
- ./scripts/release.sh
|
|
||||||
environment:
|
|
||||||
GITEA_REPO_TOKEN:
|
|
||||||
from_secret: gitea_repo_token
|
|
||||||
|
|
||||||
- name: docker
|
|
||||||
image: woodpeckerci/plugin-kaniko
|
|
||||||
depends_on: [release]
|
|
||||||
settings:
|
|
||||||
repo: ${CI_REPO_OWNER}/${CI_REPO_NAME}
|
|
||||||
registry: git.keligrubb.com
|
|
||||||
username: ${CI_REPO_OWNER}
|
|
||||||
password:
|
|
||||||
from_secret: gitea_registry_token
|
|
||||||
single-snapshot: true
|
|
||||||
cleanup: true
|
|
||||||
|
|
||||||
- name: helm
|
|
||||||
image: alpine/helm
|
|
||||||
depends_on: [release]
|
|
||||||
environment:
|
|
||||||
GITEA_REGISTRY_TOKEN:
|
|
||||||
from_secret: gitea_registry_token
|
|
||||||
commands:
|
|
||||||
- apk add --no-cache curl
|
|
||||||
- helm package helm/kestrelos
|
|
||||||
- curl -sf -u $CI_REPO_OWNER:$GITEA_REGISTRY_TOKEN -X POST --upload-file kestrelos-*.tgz https://git.keligrubb.com/api/packages/$CI_REPO_OWNER/helm/api/charts
|
|
||||||
Reference in New Issue
Block a user