ci: add Gitea Actions workflow to publish Docker image
Publish Docker image / build-and-push (push) Has been cancelled
Publish Docker image / build-and-push (push) Has been cancelled
Builds the existing Dockerfile and pushes it to the Gitea container registry on pushes to main/master and version tags.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
name: Publish Docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, master]
|
||||
tags: ['v*']
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Gitea container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ vars.GITEA_REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ vars.GITEA_REGISTRY }}/${{ github.repository }}:latest
|
||||
${{ vars.GITEA_REGISTRY }}/${{ github.repository }}:${{ github.sha }}
|
||||
Reference in New Issue
Block a user