Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build job for issuer front end. #132

Merged
merged 6 commits into from
Feb 15, 2024
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
53 changes: 53 additions & 0 deletions .github/workflows/release-test-issuer-frontend-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This job builds and publishes a docker image for the test issuer frontend to
# the dockerhub image repository.
name: Create and publish a Docker image for the issuer frontend.

on:
workflow_dispatch: # allows manual trigger

push:
tags:
- 'issuer-front-end/*.*.*'

env:
REGISTRY: docker.io
IMAGE_NAME: issuer-front-end

jobs:
build-and-push-image:
runs-on: ubuntu-latest
environment: testnet-builds
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
# Uses the `docker/login-action` action to log in to the Container registry.
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
abizjak marked this conversation as resolved.
Show resolved Hide resolved
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract tag from package.json
id: meta
run: |
export VERSION=$(jq -r .version test-tools/issuer-front-end/package.json)
export FULL_IMAGE_TAG="${{ env.REGISTRY }}/concordium/$IMAGE_NAME:$VERSION"
echo "::notice FULL_IMAGE_TAG=${FULL_IMAGE_TAG}"
# Make sure the image does not exist. Abort if we can retrieve any metadata.
if docker manifest inspect ${FULL_IMAGE_TAG} > /dev/null; then
echo "::error ${FULL_IMAGE_TAG} already exists"
exit 1
else
# Store the full image tag into a tag variable for the following step.
echo "tag=${FULL_IMAGE_TAG}" > "$GITHUB_OUTPUT"
fi
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
file: ./test-tools/issuer-front-end/Dockerfile
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tag }}
8 changes: 8 additions & 0 deletions issuer-front-end/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,11 @@ docker run -it -d -p 8080:80 --name web issuer-front-end:3.0.0
```

Open http://127.0.0.1:8080 in your browser.

## Build and push to DockerHub

To build the docker image and push to dockerhub use the
[test-issuer-front-end](https://github.com/Concordium/concordium-web3id/blob/main/.github/workflows/release-test-issuer-front-end-docker.yaml)
job.

The job will build the image, check that the version does not already exist, and push it. The job requires approval since it accesses secrets.
Loading