netmaker/.github/workflows/publish-docker.yml

95 lines
2.5 KiB
YAML
Raw Normal View History

name: Publish Docker
2021-04-09 06:05:07 +08:00
on:
workflow_dispatch:
inputs:
tag:
description: 'docker tag'
required: true
2023-02-24 05:11:57 +08:00
workflow_call:
inputs:
tag:
type: string
required: true
jobs:
docker:
runs-on: ubuntu-latest
steps:
2022-12-01 19:27:47 +08:00
-
2021-11-17 23:37:34 +08:00
name: Set tag
run: |
if [[ -n "${{ github.event.inputs.tag }}" ]]; then
TAG=${{ github.event.inputs.tag }}
elif [[ "${{ github.ref_name }}" == 'master' ]]; then
TAG="latest"
else
TAG="${{ github.ref_name }}"
fi
echo "TAG=${TAG}" >> $GITHUB_ENV
2022-12-01 19:27:47 +08:00
-
2021-11-17 23:37:34 +08:00
name: Checkout
uses: actions/checkout@v3
2022-12-01 19:27:47 +08:00
-
2021-11-17 23:37:34 +08:00
name: Set up QEMU
uses: docker/setup-qemu-action@v2
2022-12-01 19:27:47 +08:00
-
2021-11-17 23:37:34 +08:00
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
2022-12-01 19:27:47 +08:00
-
2022-12-22 23:38:45 +08:00
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
2021-11-18 02:55:51 +08:00
-
name: Build and push
uses: docker/build-push-action@v3
2021-11-18 02:55:51 +08:00
with:
context: .
platforms: linux/amd64, linux/arm64, linux/arm/v7
push: true
tags: ${{ github.repository }}:${{ env.TAG }}, ${{ github.repository }}:latest
2022-12-22 23:14:12 +08:00
build-args: |
tags=ce
docker-ee:
runs-on: ubuntu-latest
steps:
2022-12-01 19:27:47 +08:00
-
name: Set tag
run: |
if [[ -n "${{ github.event.inputs.tag }}" ]]; then
2022-12-22 22:48:09 +08:00
TAG=${{ github.event.inputs.tag }}
elif [[ "${{ github.ref_name }}" == 'master' ]]; then
TAG="latest"
else
TAG="${{ github.ref_name }}"
fi
echo "TAG=${TAG}" >> $GITHUB_ENV
2022-12-01 19:27:47 +08:00
-
name: Checkout
uses: actions/checkout@v3
2022-12-01 19:27:47 +08:00
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
2022-12-01 19:27:47 +08:00
-
name: Set up Docker Buildx
2022-12-22 23:51:48 +08:00
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
2021-11-17 23:37:34 +08:00
-
name: Build and push
uses: docker/build-push-action@v3
2021-04-09 06:05:07 +08:00
with:
context: .
2022-12-01 19:27:47 +08:00
platforms: linux/amd64, linux/arm64
push: true
tags: ${{ github.repository }}:${{ env.TAG }}-ee
2022-12-22 23:14:12 +08:00
build-args: |
tags=ee