nginx-proxy-manager-zh/.github/workflows/docker.yml
2024-01-19 11:21:27 +08:00

45 lines
1.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: GitHub Actions Docker Buildx
on:
workflow_dispatch:
push:
branches:
- 'develop-zh'
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}:${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" >> $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/setup-buildx-action@v2.5.0
- 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