Add Docker support with Dockerfile and entrypoint
All checks were successful
Docker / build (push) Successful in 28s
All checks were successful
Docker / build (push) Successful in 28s
This commit is contained in:
parent
faf880a236
commit
4bc1afa0cb
8 changed files with 118 additions and 2 deletions
44
.forgejo/workflows/docker.yml
Normal file
44
.forgejo/workflows/docker.yml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
name: Docker
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set image tag
|
||||
id: meta
|
||||
run: |
|
||||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
|
||||
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "TAG=latest" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Login to Forgejo registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.sinfonie.org
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Build image
|
||||
run: |
|
||||
docker build -t git.sinfonie.org/sinfonie/photo26:${{ steps.meta.outputs.TAG }} .
|
||||
|
||||
- name: Push image
|
||||
run: |
|
||||
docker push git.sinfonie.org/sinfonie/photo26:${{ steps.meta.outputs.TAG }}
|
||||
|
||||
- name: Tag latest (for master)
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: |
|
||||
docker tag git.sinfonie.org/sinfonie/photo26:${{ steps.meta.outputs.TAG }} git.sinfonie.org/sinfonie/photo26:latest
|
||||
docker push git.sinfonie.org/sinfonie/photo26:latest
|
||||
Loading…
Add table
Add a link
Reference in a new issue