mirror of
https://github.com/ThePhaseless/Byparr.git
synced 2026-09-24 22:03:30 +01:00
Compare commits
15
Commits
v1.0.7-fix1
...
v1.0.9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
332402652d | ||
|
|
061f0d44de | ||
|
|
b7914268bc | ||
|
|
2e8ed3fa9b | ||
|
|
6f6941e423 | ||
|
|
25ae01ba71 | ||
|
|
a065b4b7ae | ||
|
|
508568ded7 | ||
|
|
72f54fc0a9 | ||
|
|
1499cfa3df | ||
|
|
cf46f481e1 | ||
|
|
c90b0ab91e | ||
|
|
f5e75b451c | ||
|
|
0fbae3f9dd | ||
|
|
70f99e40fc |
@@ -23,33 +23,33 @@ env:
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
# test:
|
||||
# runs-on: ubuntu-latest
|
||||
# permissions:
|
||||
# contents: read
|
||||
# packages: write
|
||||
# id-token: write
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
id-token: write
|
||||
|
||||
# steps:
|
||||
# - name: Checkout repository
|
||||
# uses: actions/checkout@v4
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# - name: Set up Docker Buildx
|
||||
# uses: docker/setup-buildx-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
# - name: Test
|
||||
# id: test
|
||||
# uses: docker/build-push-action@v6
|
||||
# with:
|
||||
# context: .
|
||||
# platforms: linux/amd64
|
||||
# cache-from: type=gha,scope=x64
|
||||
# pull: true
|
||||
# cache-to: type=gha,mode=max,scope=x64
|
||||
# target: test
|
||||
- name: Test
|
||||
id: test
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64
|
||||
cache-from: type=gha,scope=x64
|
||||
pull: true
|
||||
cache-to: type=gha,mode=max,scope=x64
|
||||
target: test
|
||||
|
||||
build:
|
||||
# needs: test
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -70,7 +70,7 @@ jobs:
|
||||
SURFIX=$(echo ${{ matrix.platform }} | cut -d'/' -f2)
|
||||
echo "SURFIX=$SURFIX" >> $GITHUB_OUTPUT
|
||||
# Generate a unique local tag for the image
|
||||
echo "LOCAL_TAG=local-${{ github.sha }}-$SURFIX" >> $GITHUB_OUTPUT
|
||||
echo "LOCAL_TAG=${{ github.sha }}-$SURFIX" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
@@ -79,41 +79,22 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
# Log into registry
|
||||
- name: Log into registry ${{ env.REGISTRY }}
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# Extract metadata (tags, labels) for Docker
|
||||
- name: Extract Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=raw,enable=${{ github.ref_type == 'tag' }}, value=latest
|
||||
tags: type=raw,value=${{ steps.vars.outputs.LOCAL_TAG }}
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
|
||||
- name: Set up apt cache
|
||||
uses: actions/cache@v4
|
||||
id: cache
|
||||
with:
|
||||
path: |
|
||||
var-cache-apt
|
||||
var-lib-apt
|
||||
/root/.cache/uv
|
||||
key: cache-${{ hashFiles('Dockerfile') }}-${{ steps.vars.outputs.SURFIX }}
|
||||
|
||||
- name: Inject cache into docker
|
||||
uses: reproducible-containers/buildkit-cache-dance@v3.1.0
|
||||
with:
|
||||
cache-map: |
|
||||
{
|
||||
"var-cache-apt": "/var/cache/apt",
|
||||
"var-lib-apt": "/var/lib/apt",
|
||||
"root-cache-uv": "/root/.cache/uv"
|
||||
}
|
||||
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
|
||||
|
||||
# Build and export Docker image for each platform (without pushing)
|
||||
- name: Build Docker image
|
||||
id: build
|
||||
@@ -121,23 +102,13 @@ jobs:
|
||||
with:
|
||||
context: .
|
||||
pull: true
|
||||
push: false
|
||||
load: true # Export to local Docker instead of pushing
|
||||
tags: ${{ steps.vars.outputs.LOCAL_TAG }}
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
platforms: ${{ matrix.platform }}
|
||||
cache-from: type=gha,scope=${{ matrix.platform }}
|
||||
cache-to: type=gha,mode=max,scope=${{ matrix.platform }}
|
||||
build-args: GITHUB_BUILD=true,VERSION=${{ github.ref_type == 'tag' && github.ref_name || github.sha }}
|
||||
outputs: type=docker,dest=/tmp/image-${{ steps.vars.outputs.SURFIX }}.tar
|
||||
|
||||
# Upload the tarball as an artifact
|
||||
- name: Upload image artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: docker-image-${{ steps.vars.outputs.SURFIX }}
|
||||
path: /tmp/image-${{ steps.vars.outputs.SURFIX }}.tar
|
||||
retention-days: 1
|
||||
|
||||
merge-and-push:
|
||||
needs: build
|
||||
@@ -179,47 +150,32 @@ jobs:
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=raw,enable=${{ github.ref_type == 'tag' }}, value=latest
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
|
||||
# Download all image artifacts
|
||||
- name: Download AMD64 image
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: docker-image-amd64
|
||||
path: /tmp
|
||||
|
||||
- name: Download ARM64 image
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: docker-image-arm64
|
||||
path: /tmp
|
||||
|
||||
# Load images into Docker
|
||||
- name: Load images
|
||||
run: |
|
||||
docker load --input /tmp/image-amd64.tar
|
||||
docker load --input /tmp/image-arm64.tar
|
||||
|
||||
# Create manifest lists and push
|
||||
- name: Create and push manifest lists
|
||||
run: |
|
||||
TAGS="${{ steps.meta.outputs.tags }}"
|
||||
for TAG in $TAGS; do
|
||||
# Tag the local images with their registry counterparts
|
||||
docker tag local-${{ github.sha }}-amd64 $TAG-amd64
|
||||
docker tag local-${{ github.sha }}-arm64 $TAG-arm64
|
||||
args=""
|
||||
|
||||
# Push individual platform images
|
||||
# docker push $TAG-amd64
|
||||
# docker push $TAG-arm64
|
||||
image=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
image=${image,,}
|
||||
|
||||
# Create manifest list and push it
|
||||
docker buildx imagetools create -t $TAG \
|
||||
$TAG-amd64 \
|
||||
$TAG-arm64
|
||||
# Create tag arguments
|
||||
for tag in $TAGS; do
|
||||
args="$args -t $tag"
|
||||
done
|
||||
|
||||
if [ "${{ github.ref_type }}" == "tag" ]; then
|
||||
args="$args -t ${image}:latest"
|
||||
fi
|
||||
|
||||
echo $args
|
||||
|
||||
docker buildx imagetools create $args \
|
||||
${image}:${{github.sha}}-amd64 \
|
||||
${image}:${{github.sha}}-arm64
|
||||
|
||||
# Sign the manifest
|
||||
- name: Sign the manifests
|
||||
env:
|
||||
|
||||
+2
-4
@@ -15,10 +15,8 @@ ENV PATH="${HOME}/.local/bin:$PATH"
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||
apt update && \
|
||||
apt install -y --no-install-recommends --no-install-suggests xauth xvfb scrot wget chromium chromium-driver ca-certificates
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends --no-install-suggests xauth xvfb scrot curl chromium chromium-driver ca-certificates
|
||||
|
||||
ADD https://astral.sh/uv/install.sh install.sh
|
||||
RUN sh install.sh
|
||||
|
||||
Reference in New Issue
Block a user