69 lines
2.0 KiB
YAML
69 lines
2.0 KiB
YAML
name: publish
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
artifact-name:
|
|
required: true
|
|
type: string
|
|
|
|
|
|
jobs:
|
|
publish-docker-image:
|
|
runs-on: ubuntu_act_on_20
|
|
# container:
|
|
# image: catthehacker/ubuntu:act-latest
|
|
env:
|
|
RUNNER_TOOL_CACHE: /toolcache
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: ${{ inputs.artifact-name }}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
- name: Set up Docker BuildX
|
|
uses: docker/setup-buildx-action@v2
|
|
with:
|
|
driver-opts: |
|
|
network=act_runner_default
|
|
env.http_proxy=http://act_clash:7890
|
|
env.https_proxy=http://act_clash:7890
|
|
|
|
- name: Login to Docker Registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ${{ secrets.REGISTRY_HOST }}
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: | # my-docker-hub-namespace/my-docker-hub-repository
|
|
${{ secrets.REGISTRY_HOST }}/${{ github.repository }}
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=ref,event=pr
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern=v{{major}}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
network: host
|
|
build-args: |
|
|
http_proxy=http://192.168.0.20:7890
|
|
https_proxy=http://192.168.0.20:7890
|
|
version=${{ steps.meta.outputs.REPO_VERSION }}
|
|
context: .
|
|
file: ./docker/Dockerfile
|
|
platforms: |
|
|
linux/amd64
|
|
linux/arm64
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }} |