This commit is contained in:
parent
95f61e6de6
commit
dd20e515f9
|
@ -3,9 +3,9 @@ name: Deploy Hello World
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'master'
|
||||
tags:
|
||||
- "v*-hello-world"
|
||||
- 'v*'
|
||||
pull_request:
|
||||
branches:
|
||||
- 'master'
|
||||
|
@ -13,31 +13,35 @@ on:
|
|||
jobs:
|
||||
deploy-docker-hello-world:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Docker meta
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: git.nicktrimborn.de/nick/dockerbuild_hello_world
|
||||
flavor: latest=true
|
||||
images: |
|
||||
git.nicktrimborn.de/nick/dockerbuild_hello_world
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
|
||||
- name: Login to image repository
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
-
|
||||
name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: git.nicktrimborn.de
|
||||
username: ${{ secrets.ACTION_USER }}
|
||||
password: ${{ secrets.PASSWORD }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v3
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
file: Dockerfile
|
||||
push: true
|
||||
tags: nick/dockerbuild_hello_world:latest
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
Loading…
Reference in New Issue