Compare commits
21 Commits
6da9ef7b9b
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| b2747f1959 | |||
|
|
246e9c2667 | ||
|
|
bf2c93a084 | ||
|
|
e6d69f59e8 | ||
|
|
038c42dff7 | ||
|
|
61f65d6df0 | ||
|
|
f5fd35d12e | ||
|
|
e8bb42c1b6 | ||
| 0d10f383ec | |||
|
|
cad40e3c44 | ||
|
|
11844e9945 | ||
|
|
06355772ed | ||
|
|
3837466a7a | ||
|
|
a9179191b9 | ||
|
|
1c2261ec99 | ||
|
|
6873df57c7 | ||
|
|
9a9323e0aa | ||
|
|
36093517fb | ||
|
|
d2059c39f5 | ||
|
|
03bcf313ca | ||
|
|
8e82f3b6a2 |
@@ -27,6 +27,8 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
REGISTRY_HOST: git.dwal.in
|
||||||
|
IMAGE_NAME: zola-pwsh-s3
|
||||||
TEMPLATES_REPO_URL: ${{ vars.TEMPLATES_REPO_URL }}
|
TEMPLATES_REPO_URL: ${{ vars.TEMPLATES_REPO_URL }}
|
||||||
SCRIPTS_REPO_URL: ${{ vars.SCRIPTS_REPO_URL }}
|
SCRIPTS_REPO_URL: ${{ vars.SCRIPTS_REPO_URL }}
|
||||||
S3_ENDPOINT: ${{ vars.S3_ENDPOINT }}
|
S3_ENDPOINT: ${{ vars.S3_ENDPOINT }}
|
||||||
@@ -38,7 +40,7 @@ jobs:
|
|||||||
# Use custom container with PowerShell, Zola, AWS CLI, Git pre-installed
|
# Use custom container with PowerShell, Zola, AWS CLI, Git pre-installed
|
||||||
# Built by build-container.yaml workflow from integrations/gitea/Dockerfile
|
# Built by build-container.yaml workflow from integrations/gitea/Dockerfile
|
||||||
container:
|
container:
|
||||||
image: ${{ gitea.server_url }}/${{ gitea.repository }}/zola-pwsh-s3:latest
|
image: ${{ env.REGISTRY_HOST }}/${{ gitea.repository }}/${{ env.IMAGE_NAME }}:latest
|
||||||
credentials:
|
credentials:
|
||||||
username: ${{ gitea.actor }}
|
username: ${{ gitea.actor }}
|
||||||
password: ${{ secrets.CONTAINER_TOKEN }}
|
password: ${{ secrets.CONTAINER_TOKEN }}
|
||||||
@@ -85,13 +87,18 @@ jobs:
|
|||||||
[default]
|
[default]
|
||||||
region = garage
|
region = garage
|
||||||
output = json
|
output = json
|
||||||
|
s3 =
|
||||||
|
max_concurrent_requests = 20
|
||||||
|
max_queue_size = 10000
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
- name: Upload to S3 (Garage)
|
- name: Upload to S3 (Garage)
|
||||||
run: |
|
run: |
|
||||||
echo "Uploading to s3://$S3_BUCKET"
|
echo "Uploading to s3://$S3_BUCKET with parallel transfers"
|
||||||
aws s3 sync ./template/public/ "s3://$S3_BUCKET/" \
|
aws s3 sync ./template/public/ "s3://$S3_BUCKET/" \
|
||||||
--endpoint-url "https://$S3_ENDPOINT" \
|
--endpoint-url "https://$S3_ENDPOINT" \
|
||||||
--acl public-read \
|
--acl public-read \
|
||||||
--delete
|
--exclude "media/*" \
|
||||||
|
--delete \
|
||||||
|
--quiet
|
||||||
echo "Upload complete"
|
echo "Upload complete"
|
||||||
|
|||||||
@@ -24,44 +24,31 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE_NAME: zola-pwsh-s3
|
IMAGE_NAME: zola-pwsh-s3
|
||||||
# Use the host-accessible URL for registry, not the internal Docker hostname
|
REGISTRY_HOST: git.dwal.in
|
||||||
# If your Gitea is only accessible via gitea:3000, you may need to expose it properly
|
|
||||||
REGISTRY: ${{ gitea.server_url }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-container:
|
build-container:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Debug network and DNS
|
|
||||||
run: |
|
|
||||||
echo "=== /etc/hosts contents ==="
|
|
||||||
cat /etc/hosts
|
|
||||||
echo ""
|
|
||||||
echo "=== Trying to curl gitea by hostname ==="
|
|
||||||
curl -v http://gitea:3000 || true
|
|
||||||
echo ""
|
|
||||||
echo "=== Trying to curl gitea by IP ==="
|
|
||||||
curl -v http://172.18.0.6:3000 || true
|
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Build
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Login to Gitea Container Registry
|
- name: Login to Gitea Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY_HOST }}
|
||||||
username: ${{ gitea.actor }}
|
username: ${{ gitea.actor }}
|
||||||
password: ${{ secrets.GITEA_TOKEN }}
|
password: ${{ secrets.CONTAINER_TOKEN }}
|
||||||
|
|
||||||
- name: Extract metadata for Docker
|
- name: Extract metadata for Docker
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ gitea.repository }}/${{ env.IMAGE_NAME }}
|
images: ${{ env.REGISTRY_HOST }}/${{ gitea.repository }}/${{ env.IMAGE_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=latest
|
type=raw,value=latest
|
||||||
type=sha,prefix=
|
type=sha,prefix=
|
||||||
@@ -74,5 +61,5 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
cache-from: type=gha
|
cache-from: type=registry,ref=${{ env.REGISTRY_HOST }}/${{ gitea.repository }}/${{ env.IMAGE_NAME }}:buildcache
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=registry,ref=${{ env.REGISTRY_HOST }}/${{ gitea.repository }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
|
||||||
|
|||||||
@@ -15,18 +15,20 @@ FROM mcr.microsoft.com/powershell:lts-alpine-3.20
|
|||||||
# Copy Zola from builder
|
# Copy Zola from builder
|
||||||
COPY --from=builder /usr/local/bin/zola /usr/local/bin/zola
|
COPY --from=builder /usr/local/bin/zola /usr/local/bin/zola
|
||||||
|
|
||||||
# Install minimal dependencies: git, aws-cli (for S3), ca-certificates
|
# Install minimal dependencies: git, aws-cli (for S3), ca-certificates, nodejs (for GitHub Actions)
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
git \
|
git \
|
||||||
aws-cli \
|
aws-cli \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
|
nodejs \
|
||||||
&& rm -rf /var/cache/apk/*
|
&& rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
# Verify installations
|
# Verify installations
|
||||||
RUN pwsh -Version \
|
RUN pwsh -Version \
|
||||||
&& zola --version \
|
&& zola --version \
|
||||||
&& aws --version \
|
&& aws --version \
|
||||||
&& git --version
|
&& git --version \
|
||||||
|
&& node --version
|
||||||
|
|
||||||
WORKDIR /workspace
|
WORKDIR /workspace
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user