mirror of
https://github.com/gravitl/netmaker.git
synced 2025-02-25 00:24:37 +08:00
add test branch PR and manual gen of docker images
This commit is contained in:
parent
5df6e948b3
commit
6f9da311ef
1 changed files with 18 additions and 14 deletions
30
.github/workflows/publish-docker.yml
vendored
30
.github/workflows/publish-docker.yml
vendored
|
@ -1,15 +1,30 @@
|
||||||
name: Publish Docker
|
name: Publish Docker
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: 'docker tag'
|
||||||
|
required: true
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- 'develop'
|
- 'test'
|
||||||
- 'master'
|
- 'master'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Set tag
|
||||||
|
run: |
|
||||||
|
if [[ -n "${{ github.event.inputs.tag }}" ]]; then
|
||||||
|
TAG=${{ github.event.inputs.tag }}
|
||||||
|
elif [[ "${{ github.base_ref }}" == 'master' ]]; then
|
||||||
|
TAG="latest"
|
||||||
|
else
|
||||||
|
TAG="${{ github.base_ref }}"
|
||||||
|
fi
|
||||||
|
echo "TAG=${TAG}" >> $GITHUB_ENV
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
|
@ -22,20 +37,9 @@ jobs:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
- name: Build and push latest
|
- name: Build and push latest
|
||||||
if: github.base_ref == 'master'
|
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64, linux/arm64
|
platforms: linux/amd64, linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: gravitl/netmaker:${{ env.TAG }}
|
||||||
gravitl/netmaker:latest
|
|
||||||
- name: Build and push develop
|
|
||||||
if: github.base_ref == 'develop'
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: linux/amd64, linux/arm64
|
|
||||||
push: true
|
|
||||||
tags: |
|
|
||||||
gravitl/netmaker:develop
|
|
||||||
|
|
Loading…
Reference in a new issue