Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4973accfb4 | |||
|
a5334e8cf6
|
|||
|
a293a72451
|
|||
|
fcac6ff302
|
|||
| eb87b759f8 | |||
| bb044ee0f8 |
@@ -1,4 +1,4 @@
|
|||||||
name: Build and publish
|
name: build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -7,49 +7,18 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
# Required secrets:
|
|
||||||
# REGISTRY git.librete.ch
|
|
||||||
# REGISTRY_USER libretech-bot
|
|
||||||
# REGISTRY_PASS bot PAT (write:package; bot is in libreshop Owners team)
|
|
||||||
# Required variable:
|
|
||||||
# PUBLISH_ENABLED "true" to actually push (off = build-only on PRs)
|
|
||||||
#
|
|
||||||
# Image: git.librete.ch/libreshop/nginx
|
|
||||||
# main pushes → :main + :sha-<short>
|
|
||||||
# tag pushes → :<tag> + :latest
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: git.librete.ch/libretech/runner-image:v1
|
image: git.librete.ch/public/runner-image:v0.2.0@sha256:f60c587d3c0b0aac04a572db5349e27672bf76baec2ce547a3dcc28cebcf1b7e
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: docker/setup-buildx-action@v3
|
- uses: https://git.librete.ch/public/actions/.gitea/actions/docker-build@main
|
||||||
|
|
||||||
- name: Login (only when publishing)
|
|
||||||
if: ${{ vars.PUBLISH_ENABLED == 'true' }}
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
with:
|
||||||
registry: ${{ secrets.REGISTRY }}
|
registry: ${{ secrets.REGISTRY }}
|
||||||
username: ${{ secrets.REGISTRY_USER }}
|
registry_user: ${{ secrets.REGISTRY_USER }}
|
||||||
password: ${{ secrets.REGISTRY_PASS }}
|
registry_pass: ${{ secrets.REGISTRY_PASS }}
|
||||||
|
publish: ${{ github.event_name == 'push' && vars.PUBLISH_ENABLED == 'true' }}
|
||||||
- id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: ${{ secrets.REGISTRY }}/libreshop/nginx
|
|
||||||
tags: |
|
|
||||||
type=ref,event=branch
|
|
||||||
type=ref,event=tag
|
|
||||||
type=sha,format=short
|
|
||||||
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }}
|
|
||||||
|
|
||||||
- uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: ${{ vars.PUBLISH_ENABLED == 'true' && github.event_name == 'push' }}
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user