Skip to content

Commit 7d7a45e

Browse files
barckcodeclaude
andcommitted
ci: add release pipeline triggered by VERSION file
When VERSION is updated on main, the pipeline builds and pushes the frontend Docker image to ghcr.io/helmcode/agentcrew-frontend with both the version tag and :latest. It also creates a git tag and GitHub Release with auto-generated notes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e7a21eb commit 7d7a45e

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

.github/workflows/release.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths: [VERSION]
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Read version
19+
id: version
20+
run: echo "version=$(cat VERSION | tr -d '[:space:]')" >> "$GITHUB_OUTPUT"
21+
22+
- name: Check tag does not exist
23+
run: |
24+
if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
25+
echo "::error::Tag v${{ steps.version.outputs.version }} already exists"
26+
exit 1
27+
fi
28+
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v3
31+
32+
- name: Log in to GHCR
33+
uses: docker/login-action@v3
34+
with:
35+
registry: ghcr.io
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Build and push frontend image
40+
uses: docker/build-push-action@v6
41+
with:
42+
context: .
43+
push: true
44+
build-args: |
45+
VITE_API_URL=
46+
tags: |
47+
ghcr.io/helmcode/agentcrew-frontend:${{ steps.version.outputs.version }}
48+
ghcr.io/helmcode/agentcrew-frontend:latest
49+
cache-from: type=gha
50+
cache-to: type=gha,mode=max
51+
52+
- name: Create git tag
53+
run: |
54+
git tag "v${{ steps.version.outputs.version }}"
55+
git push origin "v${{ steps.version.outputs.version }}"
56+
57+
- name: Create GitHub Release
58+
uses: softprops/action-gh-release@v2
59+
with:
60+
tag_name: v${{ steps.version.outputs.version }}
61+
name: v${{ steps.version.outputs.version }}
62+
generate_release_notes: true

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.0

0 commit comments

Comments
 (0)