mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-11-29 08:26:21 +00:00
chore: try to separate matrix
This commit is contained in:
42
.github/workflows/docker.yml
vendored
42
.github/workflows/docker.yml
vendored
@@ -25,9 +25,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
variant:
|
||||
- name: modern
|
||||
arch: linux/amd64,linux/arm64
|
||||
- name: legacy
|
||||
- name: amd64
|
||||
arch: linux/amd64
|
||||
- name: arm64
|
||||
arch: linux/arm64
|
||||
- name: armv7
|
||||
arch: linux/arm/v7
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
@@ -68,7 +70,7 @@ jobs:
|
||||
type=sha,format=short,prefix=
|
||||
|
||||
- name: replace psycopg binary to c version for arm/v7
|
||||
if: ${{ matrix.variant.name == 'legacy' }}
|
||||
if: ${{ matrix.variant.name == 'armv7' }}
|
||||
run: |
|
||||
echo "TUNING PSYCOPG FOR ${{ matrix.variant.name }}"
|
||||
sed -i "s|psycopg\[binary\]==3.2.13|psycopg\[c\]==3.2.13|" ./src/requirements.txt
|
||||
@@ -83,7 +85,7 @@ jobs:
|
||||
context: .
|
||||
file: ./docker/Dockerfile
|
||||
push: false
|
||||
outputs: type=oci,dest=/dist/docker-${{ matrix.variant.name }}.tar
|
||||
outputs: type=docker,dest=/dist/image-${{ matrix.variant.name }}.tar
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
platforms: ${{ matrix.variant.arch }}
|
||||
@@ -91,12 +93,12 @@ jobs:
|
||||
- name: Upload docker image as artifact
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: docker-image-${{ matrix.variant.name }}
|
||||
path: /dist/docker-${{ matrix.variant.name }}.tar
|
||||
|
||||
name: image-${{ matrix.variant.name }}
|
||||
path: /dist/image-${{ matrix.variant.name }}.tar
|
||||
|
||||
docker_merge:
|
||||
runs-on: ubuntu-latest
|
||||
needs: docker_build
|
||||
# needs: docker_build
|
||||
steps:
|
||||
- name: Make workspace directory
|
||||
run: mkdir -p /workspace
|
||||
@@ -106,23 +108,35 @@ jobs:
|
||||
with:
|
||||
path: /workspace
|
||||
|
||||
- name: Install unzip
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
apt-get update && apt-get install -y unzip
|
||||
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
|
||||
for zip in $(find ./ -type f -name "docker*.zip"); do
|
||||
|
||||
echo "Extracting"
|
||||
for zip in $(find ./ -type f -name "image-*.zip"); do
|
||||
echo "Found zip: $zip";
|
||||
unzip $zip
|
||||
done
|
||||
ls -lah
|
||||
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:
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: docker_merger
|
||||
needs: docker_merge
|
||||
steps:
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
|
||||
Reference in New Issue
Block a user