-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.35 KB
/
Copy pathpublish.yaml
File metadata and controls
45 lines (38 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# See. https://docs.docker.com/build/ci/github-actions/multi-platform/
name: Publish Docker Image
run-name: "${{ github.workflow }} (version: ${{ inputs.version || 'latest only' }})"
on:
workflow_dispatch:
inputs:
version:
description: "Docker Image Version (e.g., 1.0.0). Leave empty for 'latest' only."
required: false
default: ""
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Prepare tags
id: prepare_tags
run: |
if [ -z "${{ inputs.version }}" ]; then
echo "TAGS=daido1976/aws-lambda-function-url-emulator:latest" >> $GITHUB_ENV
else
echo "TAGS=daido1976/aws-lambda-function-url-emulator:latest,daido1976/aws-lambda-function-url-emulator:${{ inputs.version }}" >> $GITHUB_ENV
fi
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.TAGS }}