-
-
Notifications
You must be signed in to change notification settings - Fork 171
69 lines (58 loc) · 2.2 KB
/
docker-publish-base.yml
File metadata and controls
69 lines (58 loc) · 2.2 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Docker Build and Publish Base Image
on:
workflow_dispatch:
env:
DOCKER_HUB_USERNAME: ifuryst
ALIYUN_REGISTRY: registry.ap-southeast-1.aliyuncs.com/amoylab
BUILDX_NO_DEFAULT_ATTESTATIONS: 1
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Set lowercase repository owner
run: echo "LOWERCASE_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Set lowercase repository name
run: echo "LOWERCASE_REPO=$(echo ${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Aliyun Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.ALIYUN_REGISTRY }}
username: ${{ secrets.ALIYUN_USERNAME }}
password: ${{ secrets.ALIYUN_PASSWORD }}
- name: Build and push base image
uses: docker/build-push-action@v5
with:
context: .
file: deploy/docker/base/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
UV_DEFAULT_INDEX=https://mirrors.aliyun.com/pypi/simple/
pnpm_config_registry=https://registry.npmmirror.com
tags: |
${{ env.DOCKER_HUB_USERNAME }}/unla-base:latest
ghcr.io/${{ env.LOWERCASE_OWNER }}/${{ env.LOWERCASE_REPO }}/base:latest
${{ env.ALIYUN_REGISTRY }}/unla-base:latest