Skip to content

Publish Docker Image #11

Publish Docker Image

Publish Docker Image #11

Workflow file for this run

name: Publish Docker Image
on:
workflow_dispatch:
inputs:
tag:
description: 'tag(latest or x.x.x)'
required: true
default: 'latest'
jobs:
check:
runs-on: ubuntu-latest
outputs:
tags: ${{ steps.check-tags.outputs.tags }}
steps:
- id: check-tags
name: check tags
run: |
if [[ "${{ github.event.inputs.tag }}" == "latest" ]]; then
echo "tags=nobodyiam/apollo-quick-start:latest" >> $GITHUB_OUTPUT
else
echo "tags=nobodyiam/apollo-quick-start:latest,nobodyiam/apollo-quick-start:${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
fi
publish:
needs: check
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: nobodyiam
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build and push
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
file: ./Dockerfile
push: true
tags: ${{ needs.check.outputs.tags }}