chore(config): add Renovate and build workflows

This commit is contained in:
Graham McIntire 2026-03-03 16:53:48 -06:00
parent 8882012a65
commit f761290ed7
No known key found for this signature in database
3 changed files with 153 additions and 0 deletions

View file

@ -0,0 +1,62 @@
name: Build
on:
push:
branches:
- main
env:
DOCKER_BUILDKIT: 1
DOCKER_TLS_CERTDIR: ""
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to container registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Extract metadata
id: meta
run: |
TIMESTAMP=$(date +%s)
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
IMAGE=${{ secrets.REGISTRY_URL }}/${{ github.repository }}
echo "image=${IMAGE}" >> $GITHUB_OUTPUT
echo "tag=${IMAGE}:main-${TIMESTAMP}-${SHORT_SHA}" >> $GITHUB_OUTPUT
echo "latest_tag=${IMAGE}:latest" >> $GITHUB_OUTPUT
echo "cache_tag=${IMAGE}:buildcache" >> $GITHUB_OUTPUT
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
${{ steps.meta.outputs.tag }}
${{ steps.meta.outputs.latest_tag }}
cache-from: type=registry,ref=${{ steps.meta.outputs.cache_tag }}
cache-to: type=registry,ref=${{ steps.meta.outputs.cache_tag }},mode=max
- name: Update deployment image tag
run: |
sed -i "s|image: git\.mcintire\.me/graham/towerops-web:.*|image: ${{ steps.meta.outputs.tag }}|g" k8s/deployment.yaml
git config user.email "ci@git.mcintire.me"
git config user.name "CI"
git add k8s/deployment.yaml
git diff --cached --quiet || git commit -m "chore: update towerops-web image to ${{ steps.meta.outputs.tag }} [skip ci]"
git push origin HEAD:main

View file

@ -0,0 +1,27 @@
name: Renovate
on:
schedule:
# Run daily at 6:00 AM UTC
- cron: '0 6 * * *'
workflow_dispatch:
jobs:
renovate:
runs-on: ubuntu-latest
container:
image: renovate/renovate:latest
steps:
- name: Checkout code
uses: https://github.com/actions/checkout@v4
- name: Run Renovate
env:
RENOVATE_PLATFORM: forgejo
RENOVATE_ENDPOINT: ${{ secrets.FORGEJO_ENDPOINT }}
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
RENOVATE_GIT_AUTHOR: Renovate Bot <bot@renovateapp.com>
RENOVATE_AUTODISCOVER: false
LOG_LEVEL: info
run: |
renovate graham/towerops-web

64
renovate.json Normal file
View file

@ -0,0 +1,64 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
],
"gitAuthor": "Renovate Bot <bot@renovateapp.com>",
"branchPrefix": "renovate/",
"semanticCommits": "enabled",
"dependencyDashboard": true,
"labels": [
"dependencies"
],
"schedule": [
"at any time"
],
"timezone": "UTC",
"prConcurrentLimit": 10,
"prCreation": "immediate",
"automerge": false,
"rangeStrategy": "bump",
"separateMajorMinor": true,
"separateMinorPatch": false,
"packageRules": [
{
"description": "Elixir dependencies",
"matchManagers": [
"mix"
],
"matchUpdateTypes": [
"major",
"minor",
"patch"
],
"groupName": null,
"commitMessagePrefix": "chore(deps):"
},
{
"description": "Docker dependencies",
"matchManagers": [
"dockerfile"
],
"matchUpdateTypes": [
"major",
"minor",
"patch"
],
"groupName": null,
"commitMessagePrefix": "chore(deps):"
},
{
"description": "GitHub Actions",
"matchManagers": [
"github-actions"
],
"matchUpdateTypes": [
"major",
"minor",
"patch"
],
"groupName": null,
"commitMessagePrefix": "chore(deps):"
}
]
}