Switched to using context variables in ci.yml
Some checks failed
CI/CD Pipeline (Fully Isolated DinD) / Run Tests (DinD) (push) Failing after 1s
CI/CD Pipeline (Fully Isolated DinD) / Build and Push Docker Images (DinD) (push) Has been skipped
CI/CD Pipeline (Fully Isolated DinD) / Deploy to Production (push) Has been skipped

This commit is contained in:
continuist 2025-07-05 13:01:25 -04:00
parent 8ae2b767cb
commit 6a7bbd7dd9

View file

@ -69,13 +69,9 @@ jobs:
# Use the pre-configured workspace directory (created in CI guide Step 7.3)
# Clone the repository to workspace
echo "GITEA_SERVER_URL: ${{ env.GITEA_SERVER_URL }}"
echo "GITEA_REPOSITORY: ${{ env.GITEA_REPOSITORY }}"
echo "gitea.server_url: ${{ gitea.server_url }}"
echo "gitea.repository: ${{ gitea.repository }}"
git clone "${{ gitea.server_url }}/${{ gitea.repository }}" /tmp/ci-workspace
cd /tmp/ci-workspace
git checkout "${{ env.GITEA_SHA }}"
git checkout "${{ gitea.sha }}"
# Copy workspace to DinD container
docker cp /tmp/ci-workspace/. ci-dind:/workspace/
@ -152,7 +148,7 @@ jobs:
docker exec ci-dind docker buildx inspect --bootstrap
# Ensure code is available in DinD (reuse from test job)
docker exec ci-dind sh -c "cd /workspace && git fetch && git reset --hard origin/${{ env.GITEA_REF }}"
docker exec ci-dind sh -c "cd /workspace && git fetch && git reset --hard origin/${{ gitea.ref_name }}"
# Verify we have the correct repository
docker exec ci-dind sh -c "cd /workspace && git remote -v"
@ -162,7 +158,7 @@ jobs:
# Build and push backend image using DinD
docker exec ci-dind docker buildx build \
--platform linux/amd64 \
--tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/backend:${{ env.GITEA_SHA }} \
--tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/backend:${{ gitea.sha }} \
--push \
--cache-from type=gha \
--cache-to type=gha,mode=max \
@ -174,7 +170,7 @@ jobs:
# Build and push frontend image using DinD
docker exec ci-dind docker buildx build \
--platform linux/amd64 \
--tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/frontend:${{ env.GITEA_SHA }} \
--tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/frontend:${{ gitea.sha }} \
--push \
--cache-from type=gha \
--cache-to type=gha,mode=max \
@ -231,7 +227,7 @@ jobs:
- name: Create environment file for deployment
run: |
# Create environment file for this deployment
echo "IMAGE_TAG=${{ env.GITEA_SHA }}" > .env
echo "IMAGE_TAG=${{ gitea.sha }}" > .env
echo "REGISTRY=${{ secrets.CI_HOST }}:443" >> .env
echo "IMAGE_NAME=${{ secrets.APP_NAME || 'sharenet' }}" >> .env
echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD || 'your_secure_password_here' }}" >> .env