gitea upload to dockerhub

This commit is contained in:
qiaofeng1227 2023-09-18 08:35:19 +08:00
parent b6707c1132
commit d7fdca5ad4
2 changed files with 39 additions and 0 deletions

36
.github/workflows/build_git.yml vendored Normal file
View file

@ -0,0 +1,36 @@
name: AppManage Build And Push To DockerHub
on:
push:
branches: [main]
paths:
- "docker/w9git/Dockerfile"
jobs:
build:
name: Build Docker image
runs-on: ubuntu-latest
env:
TAGS: latest
steps:
- uses: actions/checkout@v2
name: Check out code
- name: Get version
run: |
version=$(grep -Po '(?<=LABEL version=").*?(?=")' docker/w9git/Dockerfile)
echo $version
echo "::set-output name=version::$version"
echo "VERSION=$version" >> $GITHUB_ENV
- uses: mr-smithers-excellent/docker-build-push@v5
name: Build & push Docker image
with:
image: websoft9dev/gitea
tags: ${{ env.VERSION }}
addLatest: True
registry: docker.io
dockerfile: appmanage/Dockerfile
directory: appmanage
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

View file

@ -1,4 +1,7 @@
FROM gitea/gitea:1.20.4
LABEL maintainer="Websoft9<help@websoft9.com>"
LABEL version="1.20.4"
COPY init.sh /usr/local/bin/init.sh
COPY ./init /etc/s6/init
RUN chmod -R 755 /etc/s6/init /usr/local/bin/init.sh