mirror of
https://github.com/Finesssee/ProxyPilot.git
synced 2026-11-19 02:17:46 +00:00
- Add bundle creation step before building custom installer (copies ProxyPilot.exe, config, icons to cmd/installer/bundle/) - Make docker-image workflow conditional on DockerHub secrets - Skip docker build when credentials aren't configured
49 lines
1.4 KiB
YAML
49 lines
1.4 KiB
YAML
name: docker-image
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- v*
|
|
|
|
env:
|
|
APP_NAME: ProxyPilot
|
|
DOCKERHUB_REPO: ${{ secrets.DOCKERHUB_REPO || 'proxypilot/proxypilot' }}
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
# Only run if DockerHub credentials are available
|
|
if: ${{ secrets.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_TOKEN != '' }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
- name: Generate Build Metadata
|
|
run: |
|
|
echo VERSION=`git describe --tags --always --dirty` >> $GITHUB_ENV
|
|
echo COMMIT=`git rev-parse --short HEAD` >> $GITHUB_ENV
|
|
echo BUILD_DATE=`date -u +%Y-%m-%dT%H:%M:%SZ` >> $GITHUB_ENV
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
platforms: |
|
|
linux/amd64
|
|
linux/arm64
|
|
push: true
|
|
build-args: |
|
|
VERSION=${{ env.VERSION }}
|
|
COMMIT=${{ env.COMMIT }}
|
|
BUILD_DATE=${{ env.BUILD_DATE }}
|
|
tags: |
|
|
${{ env.DOCKERHUB_REPO }}:latest
|
|
${{ env.DOCKERHUB_REPO }}:${{ env.VERSION }}
|