Skip to content

Commit 4468e4d

Browse files
committed
Add publish.yaml
1 parent beb3ad9 commit 4468e4d

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

.github/workflows/publish.yaml

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

0 commit comments

Comments
 (0)