Forgejo Action: build and publish Docker image on merge to main #25
1 changed files with 36 additions and 0 deletions
36
.forgejo/workflows/docker-publish.yml
Normal file
36
.forgejo/workflows/docker-publish.yml
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
# Forgejo Action — build + publish Docker image to Forgejo container registry on merge to main
|
||||||
|
---
|
||||||
|
name: Docker
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: docker-builder
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Log in to Forgejo Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: forgejo.lorentz.is
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
forgejo.lorentz.is/matt/mailship:${{ github.sha }}
|
||||||
|
forgejo.lorentz.is/matt/mailship:latest
|
||||||
Loading…
Reference in a new issue