The .internal registry domain is being retired; git.schweitz.net now serves the registry without SSO on /v2/. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
72 lines
2.0 KiB
YAML
72 lines
2.0 KiB
YAML
name: Test, Build and Push
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- 'v[0-9]*'
|
|
|
|
jobs:
|
|
test-gateway:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.13'
|
|
|
|
- name: Install
|
|
run: pip install -e "./gateway[dev]"
|
|
|
|
- name: Lint and test
|
|
working-directory: gateway
|
|
run: |
|
|
ruff check src tests
|
|
ruff format --check src tests
|
|
pytest
|
|
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
steps:
|
|
- name: Create Gitea Release
|
|
run: |
|
|
curl -sf -X POST \
|
|
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"tag_name": "${{ github.ref_name }}", "name": "Release ${{ github.ref_name }}", "body": "Automated release for ${{ github.ref_name }}"}' \
|
|
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases"
|
|
|
|
build-gateway:
|
|
runs-on: ubuntu-latest
|
|
needs: test-gateway
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Login to Gitea Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: git.schweitz.net
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: gateway
|
|
push: true
|
|
provenance: false
|
|
sbom: false
|
|
tags: |
|
|
git.schweitz.net/jpmschweitzer/desklock-gateway:latest
|
|
git.schweitz.net/jpmschweitzer/desklock-gateway:${{ github.ref_name }}
|
|
|
|
- name: Trigger Watchtower update
|
|
if: success()
|
|
run: |
|
|
curl -sf -H "Authorization: Bearer ${{ secrets.WATCHTOWER_HTTP_API_TOKEN }}" \
|
|
http://watchtower:8080/v1/update
|