Kubernetes manifests for deploying to home cluster in the aprs namespace with Forgejo Actions CI pipeline for building and pushing container images to git.mcintire.me registry.
42 lines
1.1 KiB
YAML
42 lines
1.1 KiB
YAML
name: Build and Push
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Login to Forgejo Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: git.mcintire.me
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Generate image tags
|
|
id: tags
|
|
run: |
|
|
TIMESTAMP=$(date +%s)
|
|
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
|
|
TAG="main-${TIMESTAMP}-${SHORT_SHA}"
|
|
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
|
echo "Building image with tag: ${TAG}"
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: |
|
|
git.mcintire.me/graham/aprs.me:${{ steps.tags.outputs.tag }}
|
|
git.mcintire.me/graham/aprs.me:latest
|
|
cache-from: type=registry,ref=git.mcintire.me/graham/aprs.me:latest
|
|
cache-to: type=inline
|