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:
|
||||
|
||||
env:
|
||||
REGISTRY_HOST: git.dwal.in
|
||||
IMAGE_NAME: zola-pwsh-s3
|
||||
TEMPLATES_REPO_URL: ${{ vars.TEMPLATES_REPO_URL }}
|
||||
SCRIPTS_REPO_URL: ${{ vars.SCRIPTS_REPO_URL }}
|
||||
S3_ENDPOINT: ${{ vars.S3_ENDPOINT }}
|
||||
@@ -38,7 +40,7 @@ jobs:
|
||||
# Use custom container with PowerShell, Zola, AWS CLI, Git pre-installed
|
||||
# Built by build-container.yaml workflow from integrations/gitea/Dockerfile
|
||||
container:
|
||||
image: ${{ gitea.server_url }}/${{ gitea.repository }}/zola-pwsh-s3:latest
|
||||
image: ${{ env.REGISTRY_HOST }}/${{ gitea.repository }}/${{ env.IMAGE_NAME }}:latest
|
||||
credentials:
|
||||
username: ${{ gitea.actor }}
|
||||
password: ${{ secrets.CONTAINER_TOKEN }}
|
||||
@@ -85,13 +87,18 @@ jobs:
|
||||
[default]
|
||||
region = garage
|
||||
output = json
|
||||
s3 =
|
||||
max_concurrent_requests = 20
|
||||
max_queue_size = 10000
|
||||
EOF
|
||||
|
||||
- name: Upload to S3 (Garage)
|
||||
run: |
|
||||
echo "Uploading to s3://$S3_BUCKET"
|
||||
echo "Uploading to s3://$S3_BUCKET with parallel transfers"
|
||||
aws s3 sync ./template/public/ "s3://$S3_BUCKET/" \
|
||||
--endpoint-url "https://$S3_ENDPOINT" \
|
||||
--acl public-read \
|
||||
--delete
|
||||
--exclude "media/*" \
|
||||
--delete \
|
||||
--quiet
|
||||
echo "Upload complete"
|
||||
|
||||
@@ -24,44 +24,31 @@ on:
|
||||
|
||||
env:
|
||||
IMAGE_NAME: zola-pwsh-s3
|
||||
# Use the host-accessible URL for registry, not the internal Docker hostname
|
||||
# If your Gitea is only accessible via gitea:3000, you may need to expose it properly
|
||||
REGISTRY: ${{ gitea.server_url }}
|
||||
REGISTRY_HOST: git.dwal.in
|
||||
|
||||
jobs:
|
||||
build-container:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
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
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
- name: Set up Docker Build
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Gitea Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
registry: ${{ env.REGISTRY_HOST }}
|
||||
username: ${{ gitea.actor }}
|
||||
password: ${{ secrets.GITEA_TOKEN }}
|
||||
password: ${{ secrets.CONTAINER_TOKEN }}
|
||||
|
||||
- name: Extract metadata for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ gitea.repository }}/${{ env.IMAGE_NAME }}
|
||||
images: ${{ env.REGISTRY_HOST }}/${{ gitea.repository }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=raw,value=latest
|
||||
type=sha,prefix=
|
||||
@@ -74,5 +61,5 @@ jobs:
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
cache-from: type=registry,ref=${{ env.REGISTRY_HOST }}/${{ gitea.repository }}/${{ env.IMAGE_NAME }}:buildcache
|
||||
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 --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 \
|
||||
git \
|
||||
aws-cli \
|
||||
ca-certificates \
|
||||
nodejs \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
# Verify installations
|
||||
RUN pwsh -Version \
|
||||
&& zola --version \
|
||||
&& aws --version \
|
||||
&& git --version
|
||||
&& git --version \
|
||||
&& node --version
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user