websoft9/.github/workflows/build_apphub.yml
2023-09-21 16:51:55 +08:00

38 lines
1,017 B
YAML

name: apphub Build And Push To DockerHub
on:
push:
branches: [main]
paths:
- "docker/apphub/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/apphub/Dockerfile)
echo $version
echo "::set-output name=version::$version"
new_version=${version},latest
echo "VERSION=$new_version" >> $GITHUB_ENV
- uses: mr-smithers-excellent/docker-build-push@v5
name: Build & push Docker image
with:
image: websoft9dev/apphub
tags: ${{ env.VERSION }}
addLatest: True
registry: docker.io
dockerfile: docker/apphub/Dockerfile
directory: docker/apphub
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}