|
|
@ -4,6 +4,8 @@ on:
|
|
|
|
push:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
branches:
|
|
|
|
- release-*
|
|
|
|
- release-*
|
|
|
|
|
|
|
|
# tags:
|
|
|
|
|
|
|
|
# - 'v*'
|
|
|
|
|
|
|
|
|
|
|
|
release:
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
types: [published]
|
|
|
@ -15,11 +17,8 @@ on:
|
|
|
|
required: true
|
|
|
|
required: true
|
|
|
|
default: "v3.8.0"
|
|
|
|
default: "v3.8.0"
|
|
|
|
|
|
|
|
|
|
|
|
# env:
|
|
|
|
|
|
|
|
# GO_VERSION: "1.21"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
jobs:
|
|
|
|
publish-docker-images:
|
|
|
|
build-and-test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/checkout@v4
|
|
|
@ -32,12 +31,18 @@ jobs:
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
|
|
|
|
- name: Build and push Docker image
|
|
|
|
- name: Build Docker image
|
|
|
|
|
|
|
|
id: build
|
|
|
|
uses: docker/build-push-action@v5
|
|
|
|
uses: docker/build-push-action@v5
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
context: ./main-repo
|
|
|
|
context: ./main-repo
|
|
|
|
load: true
|
|
|
|
load: true
|
|
|
|
tags: "openim/openim-server:local"
|
|
|
|
tags: "openim/openim-server:local"
|
|
|
|
|
|
|
|
cache-from: type=gha
|
|
|
|
|
|
|
|
cache-to: type=gha,mode=max
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Save Docker image to file
|
|
|
|
|
|
|
|
run: docker save -o image.tar openim/openim-server:local
|
|
|
|
|
|
|
|
|
|
|
|
- name: Checkout compose repository
|
|
|
|
- name: Checkout compose repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
uses: actions/checkout@v4
|
|
|
@ -92,9 +97,25 @@ jobs:
|
|
|
|
# exit 0
|
|
|
|
# exit 0
|
|
|
|
# fi
|
|
|
|
# fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
publish-docker-images:
|
|
|
|
- name: Extract metadata for Docker # (tags, labels)
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
needs: build-and-test
|
|
|
|
if: success()
|
|
|
|
if: success()
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
path: main-repo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
|
|
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Load Docker image from file
|
|
|
|
|
|
|
|
run: docker load -i image.tar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Extract metadata for Docker (tags, labels)
|
|
|
|
id: meta
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v5.5.1
|
|
|
|
uses: docker/metadata-action@v5.5.1
|
|
|
|
with:
|
|
|
|
with:
|
|
|
@ -108,12 +129,13 @@ jobs:
|
|
|
|
type=ref,event=tag
|
|
|
|
type=ref,event=tag
|
|
|
|
type=schedule
|
|
|
|
type=schedule
|
|
|
|
type=ref,event=branch
|
|
|
|
type=ref,event=branch
|
|
|
|
type=ref,event=pr
|
|
|
|
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
type=semver,pattern=v{{version}}
|
|
|
|
type=semver,pattern=v{{version}}
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
type=semver,pattern={{major}}
|
|
|
|
type=semver,pattern={{major}}
|
|
|
|
|
|
|
|
type=semver,pattern=release-{{raw}}
|
|
|
|
type=sha
|
|
|
|
type=sha
|
|
|
|
|
|
|
|
type=raw,value=${{ github.event.inputs.tag }}
|
|
|
|
|
|
|
|
|
|
|
|
- name: Log in to Docker Hub
|
|
|
|
- name: Log in to Docker Hub
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
uses: docker/login-action@v2
|
|
|
@ -135,7 +157,7 @@ jobs:
|
|
|
|
username: ${{ secrets.ALIREGISTRY_USERNAME }}
|
|
|
|
username: ${{ secrets.ALIREGISTRY_USERNAME }}
|
|
|
|
password: ${{ secrets.ALIREGISTRY_TOKEN }}
|
|
|
|
password: ${{ secrets.ALIREGISTRY_TOKEN }}
|
|
|
|
|
|
|
|
|
|
|
|
- name: Build and push Docker images
|
|
|
|
- name: Push Docker images
|
|
|
|
uses: docker/build-push-action@v5
|
|
|
|
uses: docker/build-push-action@v5
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
context: ./main-repo
|
|
|
|
context: ./main-repo
|
|
|
|