-
-
Notifications
You must be signed in to change notification settings - Fork 3
54 lines (49 loc) · 1.59 KB
/
build_and_publish.yml
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
name: Create tagged release
on:
push:
tags:
- v*
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{secrets.HUB_USERNAME}}
password: ${{secrets.HUB_PASSWORD}}
- name: Login to Alibaba Cloud Container Registry (ACR)
uses: docker/login-action@v3
with:
username: ${{secrets.CLOUD_USERNAME}}
password: ${{secrets.CLOUD_PASSWORD}}
registry: registry.cn-hangzhou.aliyuncs.com
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
silianz/python-openbmclapi:latest
silianz/python-openbmclapi:${{env.RELEASE_VERSION}}
registry.cn-hangzhou.aliyuncs.com/silianz/python-openbmclapi:latest
registry.cn-hangzhou.aliyuncs.com/silianz/python-openbmclapi:${{env.RELEASE_VERSION}}
platforms: linux/amd64, linux/arm64