fix: use correct docker registry and image name
This commit is contained in:
@@ -22,16 +22,15 @@ on:
|
||||
type: boolean
|
||||
|
||||
env:
|
||||
# Use GHCR or your own registry
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}/ci-runner
|
||||
# Use your existing Docker registry
|
||||
REGISTRY: docker.notsosm.art
|
||||
IMAGE_NAME: euchre-camp-ci-runner
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
build-ci-image:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
# Skip if this is an auto-generated version bump commit
|
||||
if: "!contains(github.event.head_commit.message, 'chore: bump version')"
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -40,42 +39,41 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=sha,prefix={{branch}}-
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
|
||||
- name: Build and push CI image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.ci
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Update workflow documentation
|
||||
- name: Build CI image
|
||||
run: |
|
||||
echo "CI Image built and pushed successfully!"
|
||||
echo ""
|
||||
echo "Available tags:"
|
||||
echo " - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
|
||||
echo " - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}"
|
||||
docker build \
|
||||
-f Dockerfile.ci \
|
||||
-t ${{ env.IMAGE_NAME }}:latest \
|
||||
-t ${{ env.IMAGE_NAME }}:$(git rev-parse --short HEAD) \
|
||||
.
|
||||
|
||||
- name: Test CI image
|
||||
run: |
|
||||
docker run --rm \
|
||||
${{ env.IMAGE_NAME }}:latest \
|
||||
sh -c "node --version && npm --version && npx prisma --version"
|
||||
|
||||
- name: Push to registry
|
||||
run: |
|
||||
echo "Pushing to ${{ env.REGISTRY }}..."
|
||||
# Check if we can authenticate to the registry using DOCKER_LOGIN and DOCKER_PASSWORD secrets
|
||||
if [ -n "${{ secrets.DOCKER_LOGIN }}" ] && [ -n "${{ secrets.DOCKER_PASSWORD }}" ]; then
|
||||
if docker login ${{ env.REGISTRY }} -u ${{ secrets.DOCKER_LOGIN }} -p ${{ secrets.DOCKER_PASSWORD }} 2>/dev/null; then
|
||||
docker tag ${{ env.IMAGE_NAME }}:latest ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||
echo "Successfully pushed CI image to ${{ env.REGISTRY }}"
|
||||
else
|
||||
echo "Warning: Docker login failed with provided credentials"
|
||||
echo "CI image built locally but not pushed to registry"
|
||||
fi
|
||||
else
|
||||
echo "Warning: DOCKER_LOGIN or DOCKER_PASSWORD secrets not configured"
|
||||
echo "CI image built locally but not pushed to registry"
|
||||
fi
|
||||
|
||||
- name: Show usage instructions
|
||||
run: |
|
||||
echo "CI Image built successfully!"
|
||||
echo ""
|
||||
echo "To use in workflows:"
|
||||
echo " container:"
|
||||
|
||||
+2
-19
@@ -9,20 +9,13 @@ jobs:
|
||||
unit-tests:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: node:20-alpine
|
||||
image: docker.notsosm.art/euchre-camp-ci-runner:latest
|
||||
options: --user root
|
||||
|
||||
steps:
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
apk add --no-cache bash git
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run unit tests
|
||||
run: npm run test:run
|
||||
|
||||
@@ -30,7 +23,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: unit-tests
|
||||
container:
|
||||
image: node:20-alpine
|
||||
image: docker.notsosm.art/euchre-camp-ci-runner:latest
|
||||
options: --user root
|
||||
env:
|
||||
DATABASE_PROVIDER: sqlite
|
||||
@@ -38,19 +31,9 @@ jobs:
|
||||
BETTER_AUTH_SECRET: test-secret-key-for-ci-only
|
||||
|
||||
steps:
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
apk add --no-cache bash git
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Generate Prisma client
|
||||
run: npx prisma generate
|
||||
|
||||
- name: Setup SQLite database
|
||||
run: |
|
||||
# Create SQLite database file
|
||||
|
||||
@@ -9,21 +9,14 @@ jobs:
|
||||
unit-tests:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: node:20-alpine
|
||||
image: docker.notsosm.art/euchre-camp-ci-runner:latest
|
||||
options: --user root
|
||||
# Skip if this is an auto-generated version bump commit (handled by release workflow)
|
||||
if: "!contains(github.event.head_commit.message, 'chore: bump version')"
|
||||
|
||||
steps:
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
apk add --no-cache bash git
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run unit tests
|
||||
run: npm run test:run
|
||||
|
||||
Reference in New Issue
Block a user