push portainer to dockerhub

This commit is contained in:
qiaofeng1227 2023-09-18 09:01:53 +08:00
parent 10b9fc712a
commit 1db322c8f6
3 changed files with 39 additions and 1 deletions

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

@ -0,0 +1,36 @@
name: portainer Build And Push To DockerHub
on:
push:
branches: [main]
paths:
- "docker/w9deploy/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/w9deploy/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/deploy
tags: ${{ env.VERSION }}
addLatest: True
registry: docker.io
dockerfile: docker/w9deploy/Dockerfile
directory: docker/w9deploy
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

View file

@ -7,4 +7,6 @@ RUN chmod +x /init_portainer
# step2: copy build go program to portainer # step2: copy build go program to portainer
FROM portainer/portainer-ce:2.19.0 FROM portainer/portainer-ce:2.19.0
LABEL maintainer="Websoft9<help@websoft9.com>"
LABEL version="2.19.0"
COPY --from=builder /init_portainer / COPY --from=builder /init_portainer /

View file

@ -1,4 +1,4 @@
APP_NAME=git APP_NAME=websoft9-git
APP_VERSION=1.20.4 APP_VERSION=1.20.4
APP_NETWORK=websoft9 APP_NETWORK=websoft9