forked from NginxProxyManager/nginx-proxy-manager
-
Notifications
You must be signed in to change notification settings - Fork 172
45 lines (45 loc) · 1.73 KB
/
docker.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
name: GitHub Actions Docker Buildx
on:
workflow_dispatch:
push:
branches:
- 'develop-zh'
- 'zh-v[1-9].[0-9]+.[0-9]+'
release:
types: [published]
jobs:
Docker-Buildx:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: 添加Build环境变量
run: |
echo "BUILD_IMAGE=chishin/nginx-proxy-manager-zh" >> $GITHUB_ENV
echo "BUILD_PLATFORM=linux/amd64,linux/arm64,linux/arm/7" >> $GITHUB_ENV
echo "BUILD_VERSION=$(cat .version)" >> $GITHUB_ENV
- name: 添加BuildTag环境变量(push)
if: ${{ github.event_name == 'push'}}
run: |
echo "BUILD_TAG=-t ${BUILD_IMAGE}:dev-${BUILD_VERSION} -t ${BUILD_IMAGE}:dev" >> $GITHUB_ENV
- name: 添加BuildTag环境变量(release)
if: ${{ github.event_name == 'release'}}
run: |
echo "BUILD_TAG=-t ${BUILD_IMAGE}:${BUILD_VERSION} -t ${BUILD_IMAGE}:${BUILD_VERSION%.*} -t ${BUILD_IMAGE}:${BUILD_VERSION%.*.*} -t ${BUILD_IMAGE}:release -t ${BUILD_IMAGE}:latest" >> $GITHUB_ENV
- name: 登录DockerHub账号
env:
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
run: echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
- name: Docker Setup Buildx
uses: docker/[email protected]
- name: 输出Buildx环境变量
run: |
echo "BUILD_TAG=$BUILD_TAG"
echo "BUILD_IMAGE=$BUILD_IMAGE"
echo "BUILD_PLATFORM=$BUILD_PLATFORM"
echo "BUILD_VERSION=$BUILD_VERSION"
- name: Buildx Dockerfile
run: |
chmod -R 755 scripts
./scripts/buildx-zh