dockerfiles/.github/workflows/docker-build-release-base-i...

60 lines
1.7 KiB
YAML
Raw Normal View History

2022-02-09 16:54:05 +08:00
name: "docker build release base image"
on:
workflow_dispatch:
inputs:
name:
description: 'name'
required: true
default:
tag:
description: 'tag'
required: true
default:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
2022-11-11 11:35:19 +08:00
uses: actions/checkout@v3
2022-11-16 10:29:57 +08:00
with:
submodules: true
2022-02-09 16:54:05 +08:00
- name: Set up QEMU
2022-11-11 11:35:19 +08:00
uses: docker/setup-qemu-action@v2
2022-02-09 16:54:05 +08:00
- name: Set up Docker Buildx
2022-11-11 11:35:19 +08:00
uses: docker/setup-buildx-action@v2
2022-02-09 16:54:05 +08:00
- name: Login Docker Hub
2022-11-11 11:35:19 +08:00
uses: docker/login-action@v2
2022-02-09 16:54:05 +08:00
with:
username: ${{ secrets.DOCKER_USERNAME_IOIOX }}
password: ${{ secrets.DOCKER_PASSWORD_IOIOX }}
- name: Build and push to docker hub
2023-01-19 12:06:02 +08:00
uses: docker/build-push-action@v3.1.1
2022-02-09 16:54:05 +08:00
with:
context: base/${{ github.event.inputs.name }}/${{ github.event.inputs.tag }}
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ secrets.DOCKER_USERNAME_IOIOX }}/${{ github.event.inputs.name }}:${{ github.event.inputs.tag }}
- name: Login harbor
2022-11-11 11:35:19 +08:00
uses: docker/login-action@v2
2022-02-09 16:54:05 +08:00
with:
registry: ${{ secrets.HARBOR_REGISTRY }}
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}
- name: Build and push to harbor
2022-11-11 11:35:19 +08:00
uses: docker/build-push-action@v3
2022-02-09 16:54:05 +08:00
with:
context: base/${{ github.event.inputs.name }}/${{ github.event.inputs.tag }}
platforms: linux/amd64,linux/arm64
push: true
tags: |
2022-02-22 09:42:31 +08:00
${{ secrets.HARBOR_REGISTRY }}/${{ secrets.HARBOR_PROJECT_IOIOX }}/${{ github.event.inputs.name }}:${{ github.event.inputs.tag }}