Build 1Panel Docker Image #97
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build 1Panel Docker Image | |
on: | |
schedule: | |
- cron: "0 14 * * 2" # 每周二(星期二)北京时间22:00执行 | |
- cron: "0 11 * * 5" # 每周五(星期五)北京时间19:00执行 | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "1Panel Version (Empty for latest)" | |
type: string | |
push: | |
branches: | |
- main | |
jobs: | |
build_images: | |
name: Build Multi-platform Images | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Get Version | |
id: get_version | |
run: | | |
VER_INPUT=${{ github.event.inputs.version }} | |
VER_LATEST=$(curl -fsSL https://resource.fit2cloud.com/1panel/package/stable/latest) | |
if [ -z "${VER_INPUT}" ]; then echo "PANELVER=${VER_LATEST}" >> $GITHUB_OUTPUT; else echo "PANELVER=${VER_INPUT}" >> $GITHUB_OUTPUT; fi | |
- | |
name: Build and push stable | |
uses: docker/build-push-action@v4 | |
if: github.event_name != 'workflow_dispatch' | |
with: | |
push: true | |
build-args: | | |
PANELVER=${{ steps.get_version.outputs.PANELVER }} | |
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x | |
tags: ${{ secrets.DOCKERHUB_USERNAME }}/1panel:${{ steps.get_version.outputs.PANELVER }}, ${{ secrets.DOCKERHUB_USERNAME }}/1panel:latest | |
- | |
name: Build and push stable (Manually) | |
uses: docker/build-push-action@v4 | |
if: github.event_name == 'workflow_dispatch' | |
with: | |
push: true | |
build-args: | | |
PANELVER=${{ steps.get_version.outputs.PANELVER }} | |
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x | |
tags: ${{ secrets.DOCKERHUB_USERNAME }}/1panel:${{ steps.get_version.outputs.PANELVER }}, ${{ secrets.DOCKERHUB_USERNAME }}/1panel:latest |