mirror of
https://github.com/seepine/action-docker-build-push.git
synced 2025-04-02 06:10:10 +08:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a140801d37 | ||
|
b0769a37de | ||
|
714e077b61 |
13
action.yml
13
action.yml
@ -36,11 +36,16 @@ inputs:
|
||||
description: "Push is a shorthand for --output=type=registry"
|
||||
required: false
|
||||
default: 'true'
|
||||
build-args:
|
||||
description: "Docker build args"
|
||||
required: false
|
||||
default: ''
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Set up Proxy env
|
||||
shell: bash
|
||||
run: |
|
||||
echo "[$(date +'%Y-%m-%d %H:%M:%S')] ⚙️ Set up Proxy env"
|
||||
if [ -n "${{ env.HTTP_PROXY }}" ]; then
|
||||
@ -57,12 +62,14 @@ runs:
|
||||
echo "no_proxy=${{ env.no_proxy }}"
|
||||
|
||||
- name: echo Set up QEMU
|
||||
shell: bash
|
||||
run: echo -e "\n[$(date +'%Y-%m-%d %H:%M:%S')] ⚙️ Set up QEMU"
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: echo Set up Docker BuildX
|
||||
shell: bash
|
||||
run: echo -e "\n[$(date +'%Y-%m-%d %H:%M:%S')] ⚙️ Set up Docker BuildX"
|
||||
|
||||
- name: Set up Docker BuildX
|
||||
@ -74,6 +81,7 @@ runs:
|
||||
"env.no_proxy='${{ env.no_proxy }}'"
|
||||
|
||||
- name: echo Login to DockerHub
|
||||
shell: bash
|
||||
run: echo -e "\n[$(date +'%Y-%m-%d %H:%M:%S')] ⚙️ Login to DockerHub"
|
||||
if: ${{ inputs.username != '' }}
|
||||
|
||||
@ -90,6 +98,7 @@ runs:
|
||||
NO_PROXY: ${{ env.no_proxy }}
|
||||
|
||||
- name: echo Cache docker build
|
||||
shell: bash
|
||||
run: echo -e "\n[$(date +'%Y-%m-%d %H:%M:%S')] ⚙️ Cache docker build"
|
||||
|
||||
- name: Cache docker build
|
||||
@ -99,10 +108,12 @@ runs:
|
||||
key: ${{ runner.os }}-docker-build-cache
|
||||
|
||||
- name: echo Build and push
|
||||
shell: bash
|
||||
run: echo -e "\n[$(date +'%Y-%m-%d %H:%M:%S')] ⚙️ Build and push"
|
||||
|
||||
- name: Get docker meta
|
||||
id: meta
|
||||
shell: bash
|
||||
run: |
|
||||
if [ -n "${{ inputs.tags }}" ]; then
|
||||
echo TAGS=$(echo "${{ inputs.tags }}" | tr '\n' ',' | sed 's/,$//') >> $GITHUB_OUTPUT
|
||||
@ -119,6 +130,7 @@ runs:
|
||||
fi
|
||||
|
||||
- name: echo Get docker meta
|
||||
shell: bash
|
||||
run: |
|
||||
echo -e "\n[$(date +'%Y-%m-%d %H:%M:%S')] ⚙️ Get docker meta"
|
||||
echo TAGS=${{ steps.meta.outputs.TAGS }}
|
||||
@ -137,3 +149,4 @@ runs:
|
||||
build-args: |
|
||||
"http_proxy='${{ env.http_proxy }}'"
|
||||
"https_proxy='${{ env.https_proxy }}'"
|
||||
${{ inputs.build-args }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user