name: Release on: push: tags: - 'v*' permissions: contents: write packages: write jobs: release: name: Create Release runs-on: ubuntu-latest steps: - 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: Build packages run: npm run build - name: Run tests run: npm run test - name: Generate changelog id: changelog run: | # Extract version from tag VERSION=${GITHUB_REF#refs/tags/v} echo "version=$VERSION" >> $GITHUB_OUTPUT - name: Create GitHub Release uses: softprops/action-gh-release@v1 with: generate_release_notes: true draft: false prerelease: ${{ contains(github.ref, '-') }} docker-publish: name: Publish Docker Images runs-on: ubuntu-latest needs: release steps: - uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata id: meta uses: docker/metadata-action@v5 with: images: | ghcr.io/${{ github.repository }}/frontend ghcr.io/${{ github.repository }}/backend tags: | type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} - name: Build and push frontend uses: docker/build-push-action@v5 with: context: ./honeycomb push: true tags: ghcr.io/${{ github.repository }}/frontend:${{ github.ref_name }} cache-from: type=gha cache-to: type=gha,mode=max - name: Build and push backend uses: docker/build-push-action@v5 with: context: ./hive push: true tags: ghcr.io/${{ github.repository }}/backend:${{ github.ref_name }} cache-from: type=gha cache-to: type=gha,mode=max