Compare commits

...

21 Commits

Author SHA1 Message Date
b2747f1959 Merge pull request 'fix-create-site-workflow' (#2) from fix-create-site-workflow into main
All checks were successful
Build and Deploy Site / build-and-deploy (push) Successful in 2m13s
Build Container Image / build-container (push) Successful in 16s
Reviewed-on: #2
2026-01-19 22:00:14 +03:00
Krivopolenov, Artemiy
246e9c2667 S3 upload issue fixed 2026-01-19 19:56:16 +01:00
Krivopolenov, Artemiy
bf2c93a084 s3 upload improvements 2026-01-19 19:39:23 +01:00
Krivopolenov, Artemiy
e6d69f59e8 sha as tag 2026-01-19 19:21:25 +01:00
Krivopolenov, Artemiy
038c42dff7 removed incorrect flag 2026-01-19 19:01:21 +01:00
Krivopolenov, Artemiy
61f65d6df0 container deploy fixed and debug info added 2026-01-19 18:56:52 +01:00
Krivopolenov, Artemiy
f5fd35d12e Docker update to include nodejs 2026-01-19 18:49:58 +01:00
Krivopolenov, Artemiy
e8bb42c1b6 host name and image name fixed 2026-01-19 18:45:57 +01:00
0d10f383ec Merge pull request 'Docker workflow fixed' (#1) from workflow-debugging into main
Reviewed-on: #1
2026-01-19 10:27:05 +03:00
Krivopolenov, Artemiy
cad40e3c44 registry-based caching try 2026-01-19 08:18:52 +01:00
Krivopolenov, Artemiy
11844e9945 caching disabling 2026-01-18 20:42:37 +01:00
Krivopolenov, Artemiy
06355772ed simplified registry host name 2026-01-18 20:19:37 +01:00
Krivopolenov, Artemiy
3837466a7a cleaner registry name and url one more time with debug 2026-01-18 20:14:05 +01:00
Krivopolenov, Artemiy
a9179191b9 cleaner registry name and url 2026-01-18 20:11:49 +01:00
Krivopolenov, Artemiy
1c2261ec99 fixing registry url 2026-01-18 20:08:18 +01:00
Krivopolenov, Artemiy
6873df57c7 fixing registry name env 2026-01-18 20:05:15 +01:00
Krivopolenov, Artemiy
9a9323e0aa fixing secret name 2026-01-18 19:59:43 +01:00
Krivopolenov, Artemiy
36093517fb removing all debug things 2026-01-18 19:40:51 +01:00
Krivopolenov, Artemiy
d2059c39f5 more manual debugging 2026-01-18 19:33:43 +01:00
Krivopolenov, Artemiy
03bcf313ca env var debug 2026-01-18 19:29:38 +01:00
Krivopolenov, Artemiy
8e82f3b6a2 more debug info 2026-01-18 19:26:19 +01:00
3 changed files with 21 additions and 25 deletions

View File

@@ -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"

View File

@@ -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

View File

@@ -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