2022-10-28 11:41:48 +08:00
|
|
|
name: Aliyun Container Registry
|
2022-10-25 09:43:22 +08:00
|
|
|
|
|
|
|
on:
|
2022-10-28 23:17:47 +08:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
- 'develop'
|
|
|
|
paths:
|
|
|
|
- 'packages/**'
|
2022-10-28 11:41:48 +08:00
|
|
|
pull_request:
|
2022-10-25 09:43:22 +08:00
|
|
|
branches:
|
|
|
|
- '**'
|
2022-10-28 11:41:48 +08:00
|
|
|
paths:
|
|
|
|
- 'packages/**'
|
2022-10-25 09:43:22 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
push-acr:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
|
|
verdaccio:
|
|
|
|
image: verdaccio/verdaccio
|
|
|
|
ports:
|
|
|
|
- 4873:4873
|
|
|
|
steps:
|
2022-11-16 12:53:58 +08:00
|
|
|
- name: Checkout
|
2022-10-25 09:43:22 +08:00
|
|
|
uses: actions/checkout@v3
|
2022-11-29 11:31:30 +08:00
|
|
|
with:
|
|
|
|
ssh-key: ${{ secrets.SUBMODULE_SSH_KEY }}
|
|
|
|
submodules: true
|
2022-11-16 12:53:58 +08:00
|
|
|
- name: Set up QEMU
|
2022-10-25 09:43:22 +08:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2022-11-16 12:53:58 +08:00
|
|
|
- name: Set up Docker Buildx
|
2022-10-25 09:43:22 +08:00
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
with:
|
|
|
|
driver-opts: network=host
|
2022-11-16 12:53:58 +08:00
|
|
|
- name: Docker meta
|
2022-10-25 09:43:22 +08:00
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v4
|
|
|
|
with:
|
|
|
|
images: |
|
|
|
|
nocobase/nocobase
|
|
|
|
tags: |
|
|
|
|
type=ref,event=branch
|
|
|
|
type=ref,event=pr
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
2022-11-16 12:53:58 +08:00
|
|
|
- name: Login to Docker Hub
|
2022-10-25 09:43:22 +08:00
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
registry: ${{ secrets.ALI_DOCKER_REGISTRY }}
|
|
|
|
username: ${{ secrets.ALI_DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.ALI_DOCKER_PASSWORD }}
|
2022-11-16 12:53:58 +08:00
|
|
|
- name: Build and push
|
2022-10-25 09:43:22 +08:00
|
|
|
uses: docker/build-push-action@v3
|
|
|
|
with:
|
|
|
|
context: .
|
2022-11-29 11:31:30 +08:00
|
|
|
file: Dockerfile.acr
|
2022-11-16 12:53:58 +08:00
|
|
|
build-args: |
|
2022-10-25 09:43:22 +08:00
|
|
|
VERDACCIO_URL=http://localhost:4873/
|
2022-11-16 12:53:58 +08:00
|
|
|
COMMIT_HASH=${GITHUB_SHA}
|
2022-10-25 09:43:22 +08:00
|
|
|
push: true
|
|
|
|
tags: ${{ secrets.ALI_DOCKER_REGISTRY }}/${{ steps.meta.outputs.tags }}
|
2022-11-30 16:10:12 +08:00
|
|
|
|
|
|
|
- name: Save PR number
|
|
|
|
env:
|
|
|
|
PR_NUMBER: ${{ github.event.number }}
|
|
|
|
run: |
|
|
|
|
mkdir -p ./pr
|
|
|
|
echo $PR_NUMBER > ./pr/pr_number
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: pr_number
|
|
|
|
path: pr/
|
|
|
|
|
|
|
|
- name: Save image tag
|
|
|
|
env:
|
|
|
|
IMAGE_TAG: ${{ steps.meta.outputs.tags }}
|
|
|
|
run: |
|
|
|
|
mkdir -p ./image
|
|
|
|
echo $IMAGE_TAG > ./image/image_tag
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: image_tag
|
|
|
|
path: image/
|