Skip to content
Open
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
20 changes: 19 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,22 @@ jobs:
REPO_OWNER: "Local-Connectivity-Lab"
REPO_NAME: "ccn-coverage-docker"
TARGET_ARTIFACT_NAME: "ccn-coverage-api"
run: npx semantic-release
run: npx semantic-release

- name: Get version
id: get_version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "Released version: $VERSION"

- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: icr.infra.seattlecommunitynetwork.org
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Build and publish Docker image
run: |
make publish VERSION=${{ steps.get_version.outputs.VERSION }}
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ build-%: validate-semver-%
@echo "Create docker container for $(API_DOCKER_IMAGE_NAME) with version $*"
docker build -t $(API_DOCKER_IMAGE_NAME):$* .

# Publish to Docker registry (e.g., make publish VERSION=1.2.3)
.PHONY: publish
publish: validate-semver-$(VERSION)
@echo "Building and publishing $(API_DOCKER_IMAGE_NAME):$(VERSION)"
docker build -t $(API_DOCKER_IMAGE_NAME):$(VERSION) .
docker tag $(API_DOCKER_IMAGE_NAME):$(VERSION) icr.infra.seattlecommunitynetwork.org/$(API_DOCKER_IMAGE_NAME):$(VERSION)
docker tag $(API_DOCKER_IMAGE_NAME):$(VERSION) icr.infra.seattlecommunitynetwork.org/$(API_DOCKER_IMAGE_NAME):latest
docker push icr.infra.seattlecommunitynetwork.org/$(API_DOCKER_IMAGE_NAME):$(VERSION)
docker push icr.infra.seattlecommunitynetwork.org/$(API_DOCKER_IMAGE_NAME):latest
@echo "Successfully published $(API_DOCKER_IMAGE_NAME):$(VERSION) to registry"

# The target for development
.PHONY: dev
dev:
Expand Down