2022-02-10 14:13:50 +01:00
|
|
|
name: Docker Hub Deploy
|
|
|
|
|
|
|
|
on:
|
|
|
|
repository_dispatch:
|
|
|
|
types: [docker_hub]
|
|
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
docker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: mxpicture
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
2022-02-11 14:06:41 +01:00
|
|
|
- name: Extract tag name
|
2022-02-10 14:13:50 +01:00
|
|
|
shell: bash
|
2022-02-11 14:06:41 +01:00
|
|
|
run: echo "##[set-output name=tag;]$(echo ${GITHUB_REF#refs/*/})"
|
2022-02-10 14:13:50 +01:00
|
|
|
if: github.event_name != 'repository_dispatch'
|
2022-02-11 14:06:41 +01:00
|
|
|
id: extract_tag
|
2022-02-10 14:13:50 +01:00
|
|
|
|
|
|
|
- name: Build and push (on push)
|
|
|
|
id: docker_build_push
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
if: github.event_name != 'repository_dispatch'
|
|
|
|
with:
|
|
|
|
push: true
|
2022-02-11 14:06:41 +01:00
|
|
|
tags: mxpicture/netbox:${{ steps.extract_tag.outputs.tag }}
|
|
|
|
build-args: "BASE_IMAGE_VERSION=${{ steps.extract_tag.outputs.tag }}"
|
2022-02-11 14:11:15 +01:00
|
|
|
file: Dockerfile_doppler
|
2022-02-10 14:13:50 +01:00
|
|
|
|
|
|
|
- name: Build and push (on dispatch)
|
|
|
|
id: docker_build_dispatch
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
if: github.event_name == 'repository_dispatch'
|
|
|
|
with:
|
|
|
|
push: true
|
2022-02-11 14:06:41 +01:00
|
|
|
tags: mxpicture/netbox:${{ github.event.client_payload.tag }}
|
2022-02-11 14:11:15 +01:00
|
|
|
build-args: "BASE_IMAGE_VERSION=${{ github.event.client_payload.tag }}"
|
|
|
|
file: Dockerfile_doppler
|