Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/release-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Mega Release

Version: ${VERSION}

---

## Docker Images

### campsite-api

docker pull ghcr.io/web3infra-foundation/campsite-api:${VERSION}



---

## Changes

- Describe major changes here
13 changes: 6 additions & 7 deletions .github/workflows/deploy-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ on:

env:
REGISTRY_ALIAS: m8q5m4u3
REPOSITORY: mega
IMAGE_TAG_BASE: campsite-0.1.0-pre-release
REPOSITORY: mega/campsite-api
IMAGE_TAG_BASE: 0.1.0-pre-release
GCP_PROJECT_ID: infra-20250121-20260121-0235
GCP_REPOSITORY: mega
RUBY_VERSION: 3.3.4
NODE_VERSION: 18.16.1
BUNDLER_VERSION: 2.3.14
Expand Down Expand Up @@ -65,7 +64,7 @@ jobs:
- name: Build & push amd64 image (AWS + GCP)
env:
AWS_REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
GCP_IMAGE_BASE: us-central1-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.GCP_REPOSITORY }}/${{ env.REPOSITORY }}
GCP_IMAGE_BASE: us-central1-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.REPOSITORY }}
run: |
set -euo pipefail

Expand Down Expand Up @@ -113,7 +112,7 @@ jobs:
docker manifest push "$IMAGE_BASE:${{ env.IMAGE_TAG_BASE }}"

deploy-aws:
if: ${{ github.repository == 'web3infra-foundation/mega' }}
if: ${{ github.repository == 'web3infra-foundation/campsite' }}
needs: manifest
runs-on: ubuntu-latest
strategy:
Expand All @@ -137,7 +136,7 @@ jobs:

deploy-gcp:
needs: manifest
if: ${{ github.repository == 'web3infra-foundation/mega' }}
if: ${{ github.repository == 'web3infra-foundation/campsite' }}
runs-on: ubuntu-latest
steps:
- name: Auth to GCP
Expand All @@ -148,7 +147,7 @@ jobs:
- name: Deploy to Cloud Run (force new revision)
env:
REGION: asia-east1
SERVICE_NAME: buck2-hub-campsite
SERVICE_NAME: buck2hub-campsite
run: |
set -euo pipefail

Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release

on:
push:
tags:
- "v*"

env:
RUBY_VERSION: 3.3.4
NODE_VERSION: 18.16.1
BUNDLER_VERSION: 2.3.14
permissions:
contents: write
packages: write
jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Tag
id: tag
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Build and Push
uses: docker/build-push-action@v5
with:
context: api
file: api/Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/campsite-api:${{ steps.tag.outputs.TAG }}
ghcr.io/${{ github.repository_owner }}/campsite-api:latest
build-args: |
RUBY_VERSION=${{ env.RUBY_VERSION }}
NODE_VERSION=${{ env.NODE_VERSION }}
BUNDLER_VERSION=${{ env.BUNDLER_VERSION }}
create-release:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4

- name: Generate Release Notes
run: |
VERSION=${GITHUB_REF#refs/tags/}
sed "s/\${VERSION}/$VERSION/g" .github/release-template.md > release.md

- name: Create Release
uses: softprops/action-gh-release@v2
with:
body_path: release.md
overwrite_files: true