hackertours/.forgejo/workflows/image.yaml

34 lines
1.1 KiB
YAML
Raw Normal View History

2024-07-30 18:57:12 +02:00
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
2024-07-30 19:48:20 +02:00
- name: Checkout project
uses: actions/checkout@v4
2024-07-30 19:23:34 +02:00
- name: Run hugo
2024-07-30 19:43:12 +02:00
run: docker run --rm -it -v ${{ github.workspace }}:/src docker.io/hugomods/hugo:latest hugo
2024-07-30 19:48:20 +02:00
- name: Compute Image Metadata
uses: docker/metadata-action@v5
2024-07-30 18:57:12 +02:00
id: metadata
with:
images: git.hamburg.ccc.de/${{ github.repository }}/hackertours
tags: |
type=raw,value=latest,enable={{is_default_branch}}
2024-07-30 19:48:20 +02:00
- name: Log in to Image Registry
uses: docker/login-action@v3
2024-07-30 18:57:12 +02:00
with:
registry: git.hamburg.ccc.de
username: ${{ github.actor }}
password: ${{ secrets.REPO_TOKEN }}
2024-07-30 19:48:20 +02:00
- name: Build image with kaniko
uses: https://github.com/int128/kaniko-action@v1
2024-07-30 18:57:12 +02:00
with:
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache: true
cache-repository: git.hamburg.ccc.de/${{ github.repository }}/cache