mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-11-29 08:26:21 +00:00
chore: streamline workflow
This commit is contained in:
28
.github/workflows/docker.yml
vendored
28
.github/workflows/docker.yml
vendored
@@ -23,6 +23,12 @@ jobs:
|
|||||||
packages: write
|
packages: write
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
variant:
|
||||||
|
- name: modern
|
||||||
|
arch: linux/amd64,linux/arm64
|
||||||
|
- name: legacy
|
||||||
|
arch: linux/arm/v7
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -44,10 +50,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: |
|
platforms: ${{ matrix.variant.arch }}
|
||||||
- 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
|
||||||
@@ -64,22 +67,13 @@ jobs:
|
|||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
type=sha,format=short,prefix=
|
type=sha,format=short,prefix=
|
||||||
|
|
||||||
- name: Build and export (AMD64 & ARM64)
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./docker/Dockerfile
|
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
|
|
||||||
|
|
||||||
- name: replace psycopg binary to c version for arm/v7
|
- name: replace psycopg binary to c version for arm/v7
|
||||||
|
if: ${{ matrix.variant.name == 'legacy' }}
|
||||||
run: |
|
run: |
|
||||||
|
echo "TUNING PSYCOPG FOR ${{ matrix.variant.name }}"
|
||||||
sed -i "s|psycopg\[binary\]==3.2.13|psycopg\[c\]==3.2.13|" ./src/requirements.txt
|
sed -i "s|psycopg\[binary\]==3.2.13|psycopg\[c\]==3.2.13|" ./src/requirements.txt
|
||||||
|
|
||||||
- name: Build and export arm/v7
|
- name: Build and export Docker image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
@@ -87,7 +81,7 @@ jobs:
|
|||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
platforms: linux/arm/v7
|
platforms: ${{ matrix.variant.arch }}
|
||||||
|
|
||||||
docker_scan:
|
docker_scan:
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
Reference in New Issue
Block a user