mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-11-29 08:26:21 +00:00
revert to old method with changes
This commit is contained in:
58
.github/workflows/docker.yml
vendored
58
.github/workflows/docker.yml
vendored
@@ -23,14 +23,6 @@ jobs:
|
|||||||
packages: write
|
packages: write
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
|
||||||
variant:
|
|
||||||
- name: amd64
|
|
||||||
arch: linux/amd64
|
|
||||||
- name: arm64
|
|
||||||
arch: linux/arm64
|
|
||||||
- name: armv7
|
|
||||||
arch: linux/arm/v7
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -52,7 +44,7 @@ jobs:
|
|||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
with:
|
with:
|
||||||
platforms: ${{ matrix.variant.arch }}
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@@ -84,54 +76,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./docker/Dockerfile
|
file: ./docker/Dockerfile
|
||||||
push: false
|
push: true
|
||||||
outputs: type=docker,dest=/dist/image-${{ matrix.variant.name }}.tar
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
platforms: ${{ matrix.variant.arch }}
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
|
|
||||||
- name: Upload docker image as artifact
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
with:
|
|
||||||
name: image-${{ matrix.variant.name }}
|
|
||||||
path: /dist/image-${{ matrix.variant.name }}.tar
|
|
||||||
|
|
||||||
docker_merge:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
# needs: docker_build
|
|
||||||
steps:
|
|
||||||
- name: Make workspace directory
|
|
||||||
run: mkdir -p /workspace
|
|
||||||
|
|
||||||
- name: Download all artifacts
|
|
||||||
uses: actions/download-artifact@v5
|
|
||||||
with:
|
|
||||||
path: /workspace
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
mv /etc/apt/sources.list.d/microsoft-prod.list /etc/apt/sources.list.d/microsoft-prod.list.disabled
|
|
||||||
|
|
||||||
apt-get update && apt-get install -y unzip tree
|
|
||||||
|
|
||||||
- name: List workspace contents
|
|
||||||
run: |
|
|
||||||
cd /workspace
|
|
||||||
|
|
||||||
echo "Extracting"
|
|
||||||
for zip in $(find ./ -type f -name "image-*.zip"); do
|
|
||||||
echo "Found zip: $zip";
|
|
||||||
unzip $zip
|
|
||||||
done
|
|
||||||
ls -lah && tree
|
|
||||||
|
|
||||||
echo "Loading"
|
|
||||||
for tar in $(find ./ -type f -name "image-*.tar"); do
|
|
||||||
echo "Found zip: $tar";
|
|
||||||
docker load -i $tar
|
|
||||||
done
|
|
||||||
|
|
||||||
docker images
|
|
||||||
|
|
||||||
docker_scan:
|
docker_scan:
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ RUN make && chmod +x wg*
|
|||||||
# Use the python-alpine image for building pip dependencies
|
# Use the python-alpine image for building pip dependencies
|
||||||
FROM python:3.14-alpine AS pip-builder
|
FROM python:3.14-alpine AS pip-builder
|
||||||
|
|
||||||
|
ARG TARGETPLATFORM
|
||||||
|
|
||||||
# Add the build dependencies and create a Python virtual environment.
|
# Add the build dependencies and create a Python virtual environment.
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
build-base \
|
build-base \
|
||||||
@@ -72,6 +74,11 @@ RUN apk add --no-cache \
|
|||||||
|
|
||||||
# Copy the requirements file into the build layer.
|
# Copy the requirements file into the build layer.
|
||||||
COPY ./src/requirements.txt /opt/wgdashboard/src
|
COPY ./src/requirements.txt /opt/wgdashboard/src
|
||||||
|
RUN if [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
|
||||||
|
sed -i "s|psycopg\[binary\]==3.2.13|psycopg\[c\]==3.2.13|" /opt/wgdashboard/src/requirements.txt; \
|
||||||
|
fi; \
|
||||||
|
cat /opt/wgdashboard/src/requirements.txt
|
||||||
|
|
||||||
# Install the pip packages
|
# Install the pip packages
|
||||||
RUN . /opt/wgdashboard/src/venv/bin/activate && \
|
RUN . /opt/wgdashboard/src/venv/bin/activate && \
|
||||||
pip3 install --upgrade pip && \
|
pip3 install --upgrade pip && \
|
||||||
|
|||||||
Reference in New Issue
Block a user