feat: enhance Proxmox user management and admin updates functionality #27
This file contains hidden or 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: Docker Build & Publish (OCI Dev) | |
| # Rolling dev image: dev + dev-<branch>-<sha>. develop never updates :latest. | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| paths: | |
| - "Dockerfile.oci" | |
| - ".github/workflows/docker-oci-dev.yml" | |
| - "backend/**" | |
| - "frontendv2/**" | |
| - "runner/**" | |
| - "oci/**" | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: "Branch to build (e.g., develop). Defaults to checked-out ref." | |
| required: false | |
| type: string | |
| jobs: | |
| build-oci: | |
| name: Build & Push OCI Image (Dev) - ${{ matrix.platform }} | |
| runs-on: ${{ matrix.runner }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: linux/amd64 | |
| runner: ubuntu-latest | |
| cache-key: amd64 | |
| - platform: linux/arm64 | |
| runner: ubuntu-24.04-arm | |
| cache-key: arm64 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.inputs.branch || github.ref }} | |
| - name: Set lowercase repository owner | |
| id: repo-owner | |
| run: | | |
| REPO_OWNER_LOWER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') | |
| echo "owner=$REPO_OWNER_LOWER" >> $GITHUB_OUTPUT | |
| - name: Set image tags | |
| id: tags | |
| run: | | |
| # Use checked-out HEAD so manifest job matches per-arch tags (github.sha on workflow_dispatch can differ). | |
| SHORT_SHA=$(git rev-parse --short HEAD) | |
| BRANCH_NAME="${{ github.ref_name }}" | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.branch }}" ]; then | |
| BRANCH_NAME="${{ github.event.inputs.branch }}" | |
| fi | |
| BRANCH_NAME=$(echo "$BRANCH_NAME" | sed 's/\//-/g') | |
| echo "dev=dev" >> $GITHUB_OUTPUT | |
| echo "sha=$SHORT_SHA" >> $GITHUB_OUTPUT | |
| echo "branch=$BRANCH_NAME" >> $GITHUB_OUTPUT | |
| echo "full=dev-${BRANCH_NAME}-${SHORT_SHA}" >> $GITHUB_OUTPUT | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set platform tag | |
| id: platform-tag | |
| run: | | |
| PLATFORM_TAG=$(echo "${{ matrix.platform }}" | sed 's/\//-/g') | |
| echo "tag=$PLATFORM_TAG" >> $GITHUB_OUTPUT | |
| - name: Build & Push OCI Image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile.oci | |
| platforms: ${{ matrix.platform }} | |
| push: true | |
| cache-from: | | |
| type=registry,ref=ghcr.io/${{ steps.repo-owner.outputs.owner }}/featherpanel-oci:buildcache-${{ matrix.cache-key }} | |
| type=gha | |
| cache-to: | | |
| type=registry,ref=ghcr.io/${{ steps.repo-owner.outputs.owner }}/featherpanel-oci:buildcache-${{ matrix.cache-key }},mode=max | |
| type=gha,mode=max | |
| tags: | | |
| ghcr.io/${{ steps.repo-owner.outputs.owner }}/featherpanel-oci:dev-${{ steps.tags.outputs.branch }}-${{ steps.tags.outputs.sha }}-${{ steps.platform-tag.outputs.tag }} | |
| manifest-oci: | |
| name: Create Multi-Arch Manifest - OCI (Dev) | |
| runs-on: ubuntu-latest | |
| needs: build-oci | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.inputs.branch || github.ref }} | |
| - name: Set lowercase repository owner | |
| id: repo-owner | |
| run: | | |
| REPO_OWNER_LOWER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') | |
| echo "owner=$REPO_OWNER_LOWER" >> $GITHUB_OUTPUT | |
| - name: Set image tags | |
| id: tags | |
| run: | | |
| SHORT_SHA=$(git rev-parse --short HEAD) | |
| BRANCH_NAME="${{ github.ref_name }}" | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.branch }}" ]; then | |
| BRANCH_NAME="${{ github.event.inputs.branch }}" | |
| fi | |
| BRANCH_NAME=$(echo "$BRANCH_NAME" | sed 's/\//-/g') | |
| echo "sha=$SHORT_SHA" >> $GITHUB_OUTPUT | |
| echo "branch=$BRANCH_NAME" >> $GITHUB_OUTPUT | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Wait for platform-specific images | |
| run: | | |
| echo "Waiting for platform-specific images to be available..." | |
| sleep 10 | |
| - name: Create and push manifest (dev + branch + sha) | |
| run: | | |
| OWNER="${{ steps.repo-owner.outputs.owner }}" | |
| B="${{ steps.tags.outputs.branch }}" | |
| S="${{ steps.tags.outputs.sha }}" | |
| echo "Publishing multi-arch manifests for: dev, dev-${B}, dev-${B}-${S}" | |
| docker buildx imagetools create --tag "ghcr.io/${OWNER}/featherpanel-oci:dev" \ | |
| "ghcr.io/${OWNER}/featherpanel-oci:dev-${B}-${S}-linux-amd64" \ | |
| "ghcr.io/${OWNER}/featherpanel-oci:dev-${B}-${S}-linux-arm64" | |
| docker buildx imagetools create --tag "ghcr.io/${OWNER}/featherpanel-oci:dev-${B}" \ | |
| "ghcr.io/${OWNER}/featherpanel-oci:dev-${B}-${S}-linux-amd64" \ | |
| "ghcr.io/${OWNER}/featherpanel-oci:dev-${B}-${S}-linux-arm64" | |
| docker buildx imagetools create --tag "ghcr.io/${OWNER}/featherpanel-oci:dev-${B}-${S}" \ | |
| "ghcr.io/${OWNER}/featherpanel-oci:dev-${B}-${S}-linux-amd64" \ | |
| "ghcr.io/${OWNER}/featherpanel-oci:dev-${B}-${S}-linux-arm64" | |
| echo "--- ghcr.io/${OWNER}/featherpanel-oci:dev (inspect) ---" | |
| docker buildx imagetools inspect "ghcr.io/${OWNER}/featherpanel-oci:dev" |