ci) add gitea actions and refresh readme (#1)
Some checks failed
Build and Push Image / docker-build-and-push (push) Failing after 2m13s
Some checks failed
Build and Push Image / docker-build-and-push (push) Failing after 2m13s
Summary:\n- replace scaffold README with project-specific setup, testing, Docker, and CI docs\n- add PR workflow to run lint, unit tests, app build, and Docker build\n- add main-branch workflow to build and push Docker images to Gitea registry\n\nNotes:\n- publish workflow expects REGISTRY_USERNAME and REGISTRY_PASSWORD repository secrets\n- image tags pushed: latest and short commit SHA\n\nTesting:\n- not run locally (workflows execute in Gitea Actions) Reviewed-on: CampbellWireless/trips#1 Co-authored-by: Shaun Campbell <shaun@campbellwireless.net> Co-committed-by: Shaun Campbell <shaun@campbellwireless.net>
This commit was merged in pull request #1.
This commit is contained in:
44
.gitea/workflows/pr-checks.yml
Normal file
44
.gitea/workflows/pr-checks.yml
Normal file
@@ -0,0 +1,44 @@
|
||||
name: PR Checks
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
lint-test-and-docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
env:
|
||||
REPO_URL: https://cloud.campbellwireless.net/git/${{ github.repository }}.git
|
||||
run: |
|
||||
set -eux
|
||||
git init .
|
||||
git remote add origin "$REPO_URL"
|
||||
auth="$(printf '%s' '${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}' | base64 | tr -d '\n')"
|
||||
git config --local http.https://cloud.campbellwireless.net/.extraheader "AUTHORIZATION: basic $auth"
|
||||
git fetch --prune --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/*
|
||||
git checkout --detach "${{ github.sha }}"
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: '1.3.3'
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install --frozen-lockfile
|
||||
|
||||
- name: Generate SvelteKit files
|
||||
run: bun run prepare
|
||||
|
||||
- name: Lint
|
||||
run: bun run lint
|
||||
|
||||
- name: Unit tests
|
||||
run: bunx --bun svelte-kit sync && bunx --bun vitest run --maxWorkers=1
|
||||
|
||||
- name: Build app
|
||||
run: bun run build
|
||||
|
||||
- name: Build Docker image
|
||||
run: docker build --file Dockerfile --tag trips:pr-${{ github.sha }} .
|
||||
Reference in New Issue
Block a user