Compare commits
6 Commits
v0.1.1
...
5e2dbbc2be
| Author | SHA1 | Date | |
|---|---|---|---|
| 5e2dbbc2be | |||
| da9c6ae70b | |||
| 8cf3f2d401 | |||
| 69abec3b87 | |||
| 92c064c264 | |||
| 59009f0bf7 |
@@ -0,0 +1,105 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: euchre-camp
|
||||||
|
IMAGE_NAME: euchre-camp
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: "!contains(github.event.head_commit.message, 'chore: bump version')"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: npm run test:run
|
||||||
|
|
||||||
|
- name: Configure Git
|
||||||
|
run: |
|
||||||
|
git config user.name "Gitea Actions"
|
||||||
|
git config user.email "actions@gitea.com"
|
||||||
|
|
||||||
|
- name: Determine version bump type
|
||||||
|
id: bump_type
|
||||||
|
run: |
|
||||||
|
# Get commits since last tag
|
||||||
|
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
|
||||||
|
if [ -z "$LAST_TAG" ]; then
|
||||||
|
COMMITS=$(git log --oneline)
|
||||||
|
else
|
||||||
|
COMMITS=$(git log --oneline ${LAST_TAG}..HEAD)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if echo "$COMMITS" | grep -q "BREAKING\|!:"; then
|
||||||
|
echo "bump=major" >> $GITHUB_OUTPUT
|
||||||
|
elif echo "$COMMITS" | grep -q "^feat"; then
|
||||||
|
echo "bump=minor" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "bump=patch" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Bump version
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
BUMP="${{ steps.bump_type.outputs.bump }}"
|
||||||
|
echo "Bumping version: $BUMP"
|
||||||
|
npm run version:$BUMP
|
||||||
|
|
||||||
|
# Get new version
|
||||||
|
NEW_VERSION=$(node -p "require('./package.json').version")
|
||||||
|
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Commit and push version bump
|
||||||
|
run: |
|
||||||
|
git add package.json CHANGELOG.md
|
||||||
|
git commit -m "chore: bump version to v${{ steps.version.outputs.new_version }}"
|
||||||
|
git push origin main
|
||||||
|
|
||||||
|
- name: Create git tag
|
||||||
|
run: |
|
||||||
|
git tag -a "v${{ steps.version.outputs.new_version }}" -m "Release v${{ steps.version.outputs.new_version }}"
|
||||||
|
git push origin "v${{ steps.version.outputs.new_version }}"
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Build Docker image
|
||||||
|
run: |
|
||||||
|
# Build with docker.notsosm.art registry
|
||||||
|
docker build \
|
||||||
|
--build-arg GIT_COMMIT=${{ github.sha }} \
|
||||||
|
-t docker.notsosm.art/euchre-camp:${{ steps.version.outputs.new_version }} \
|
||||||
|
-t docker.notsosm.art/euchre-camp:latest \
|
||||||
|
.
|
||||||
|
|
||||||
|
- name: Push Docker images
|
||||||
|
run: |
|
||||||
|
# Push to docker.notsosm.art registry
|
||||||
|
echo "Pushing to docker.notsosm.art..."
|
||||||
|
docker push docker.notsosm.art/euchre-camp:${{ steps.version.outputs.new_version }}
|
||||||
|
docker push docker.notsosm.art/euchre-camp:latest
|
||||||
|
|
||||||
|
- name: Deploy to dev (placeholder)
|
||||||
|
run: |
|
||||||
|
echo "Deploying version ${{ steps.version.outputs.new_version }} to dev environment..."
|
||||||
|
# TODO: Add actual deployment steps
|
||||||
|
# Example: SSH to dev server and update container
|
||||||
|
# ssh user@dev-server "cd /path/to/app && docker compose pull && docker compose up -d"
|
||||||
@@ -14,7 +14,7 @@ const fs = require('fs');
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
// Configuration
|
// Configuration
|
||||||
const REGISTRY = 'euchre-camp';
|
const REGISTRY = 'docker.notsosm.art';
|
||||||
const IMAGE_NAME = 'euchre-camp';
|
const IMAGE_NAME = 'euchre-camp';
|
||||||
const FULL_IMAGE_NAME = `${REGISTRY}/${IMAGE_NAME}`;
|
const FULL_IMAGE_NAME = `${REGISTRY}/${IMAGE_NAME}`;
|
||||||
|
|
||||||
|
|||||||
@@ -168,13 +168,21 @@ export default function AdminMatchesPage() {
|
|||||||
{match.team2Score}
|
{match.team2Score}
|
||||||
</td>
|
</td>
|
||||||
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
|
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
|
||||||
<button
|
<div className="flex gap-3">
|
||||||
onClick={() => handleDelete(match.id)}
|
<Link
|
||||||
disabled={deletingId === match.id}
|
href={`/matches/${match.id}`}
|
||||||
className="text-red-600 hover:text-red-900 disabled:opacity-50"
|
className="text-blue-600 hover:text-blue-900"
|
||||||
>
|
>
|
||||||
{deletingId === match.id ? "Deleting..." : "Delete"}
|
View
|
||||||
</button>
|
</Link>
|
||||||
|
<button
|
||||||
|
onClick={() => handleDelete(match.id)}
|
||||||
|
disabled={deletingId === match.id}
|
||||||
|
className="text-red-600 hover:text-red-900 disabled:opacity-50"
|
||||||
|
>
|
||||||
|
{deletingId === match.id ? "Deleting..." : "Delete"}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
|
|||||||
Reference in New Issue
Block a user