42 lines
1.0 KiB
YAML
42 lines
1.0 KiB
YAML
name: build-and-push
|
|
run-name: "build-and-push · ${{ gitea.ref_name }}"
|
|
# Builds the homepage image and pushes it to this Gitea instance's container
|
|
# registry as git.ffaerber.duckdns.org/ffaerber/homepage:latest on every push to main.
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
env:
|
|
IMAGE: git.ffaerber.duckdns.org/ffaerber/homepage
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ci-runner
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to container registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: git.ffaerber.duckdns.org
|
|
username: ffaerber
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: |
|
|
${{ env.IMAGE }}:latest
|
|
${{ env.IMAGE }}:${{ gitea.sha }}
|
|
provenance: false |