Repository navigation
fix #1622
Workflow file for this run
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: Build-Docker-dev | |
| on: | |
| push: | |
| branches-ignore: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| IMAGE_NAME: pasarguard/${{ github.event.repository.name }} | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| build-dashboard: | |
| if: ${{ github.event_name == 'workflow_dispatch' || !contains(github.ref_name, '/') }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| working-directory: ./dashboard | |
| run: bun install --frozen-lockfile | |
| - name: Build dashboard | |
| run: ./build_dashboard.sh | |
| - name: Upload dashboard build | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: dashboard-build | |
| path: ./dashboard/build/ | |
| retention-days: 1 | |
| build-images: | |
| needs: build-dashboard | |
| strategy: | |
| matrix: | |
| arch: [amd64, arm64] | |
| include: | |
| - arch: amd64 | |
| platform: linux/amd64 | |
| runner: ubuntu-24.04 | |
| - arch: arm64 | |
| platform: linux/arm64 | |
| runner: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Download dashboard build | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: dashboard-build | |
| path: ./dashboard/build/ | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push ${{ matrix.arch }} image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| platforms: ${{ matrix.platform }} | |
| push: true | |
| file: ./Dockerfile | |
| tags: | | |
| ${{ env.IMAGE_NAME }}:${{ github.ref_name }}-${{ matrix.arch }} | |
| ghcr.io/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-${{ matrix.arch }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| push-manifest: | |
| needs: [build-images] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create tagged manifest | |
| uses: int128/docker-manifest-create-action@v2 | |
| with: | |
| tags: ${{ env.IMAGE_NAME }}:${{ github.ref_name }} | |
| sources: | | |
| ${{ env.IMAGE_NAME }}:${{ github.ref_name }}-amd64 | |
| ${{ env.IMAGE_NAME }}:${{ github.ref_name }}-arm64 | |
| - name: Create tagged manifest for GitHub | |
| uses: int128/docker-manifest-create-action@v2 | |
| with: | |
| tags: ghcr.io/${{ env.IMAGE_NAME }}:${{ github.ref_name }} | |
| sources: | | |
| ghcr.io/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-amd64 | |
| ghcr.io/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-arm64 |