diff --git a/.github/workflows/release-on-tag.yml b/.github/workflows/release-on-tag.yml new file mode 100644 index 0000000..28d4300 --- /dev/null +++ b/.github/workflows/release-on-tag.yml @@ -0,0 +1,61 @@ +name: Build and Push Container + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +# on: +# push: +# branches: [ "master" ] +# pull_request: +# branches: [ "master" ] + +on: workflow_dispatch +# push: +# # Pattern matched against refs/tags +# tags: +# - '*' # Push events to every tag not containing / + +jobs: + + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --file pom.xml + + + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: epoch-server + build-args: | + VERSION=${{ github.ref }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/README.md b/README.md index f866e28..65209da 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ Zookeeper ## Usage -The Epoch server container is available at [quay.io](quay.io/santanu_sinha/epoch-server). +The Epoch server container is available at [ghcr.io](ghcr.io/phonepe/epoch-server). The container is intended to be run on a Drove cluster. @@ -116,7 +116,7 @@ The following is a sample app specification for deploying the epoch container on "version": "1", "executable": { "type": "DOCKER", - "url": "quay.io/santanu_sinha/epoch-server:1.9", + "url": "ghcr.io/phonepe/epoch:latest", "dockerPullTimeout": "2 minute" }, "exposedPorts": [ diff --git a/epoch-server/example/epoch-local.json b/epoch-server/example/epoch-local.json index a85a01f..c381312 100644 --- a/epoch-server/example/epoch-local.json +++ b/epoch-server/example/epoch-local.json @@ -3,7 +3,7 @@ "version": "1", "executable": { "type": "DOCKER", - "url": "quay.io/santanu_sinha/epoch-server:1.9", + "url": "ghcr.io/phonepe/epoch-server:latest", "dockerPullTimeout": "2 minute" }, "exposedPorts": [