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 release actions for dApp examples #70

Merged
merged 14 commits into from
Apr 11, 2024
Merged
55 changes: 55 additions & 0 deletions .github/workflows/release-auction-sponsored-txs-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This job builds and publishes a docker image for the sponsored transactions auction dApp to
# the dockerhub image repository.
name: Create and publish a Docker image for the sponsored transactions auction dApp.

on:
workflow_dispatch: # allows manual trigger

push:
tags:
# The versioning is of the format: `frontend_version-backend_version`.
- 'cis2-sponsored-transactions/*.*.*-*.*.*'

env:
REGISTRY: docker.io
IMAGE_NAME: dapp-auction-sponsored-txs
abizjak marked this conversation as resolved.
Show resolved Hide resolved

jobs:
build-and-push-image:
runs-on: ubuntu-latest
environment: testnet-deployments
abizjak marked this conversation as resolved.
Show resolved Hide resolved
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
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract tag from package.json
abizjak marked this conversation as resolved.
Show resolved Hide resolved
id: meta
run: |
export FRONTEND_VERSION=$(jq -r .version sponsoredTransactionsAuction/frontend/package.json)
export BACKEND_VERSION=$(yq .package.version sponsoredTransactionsAuction/backend/Cargo.toml)
export FULL_IMAGE_TAG="${{ env.REGISTRY }}/concordium/$IMAGE_NAME:$FRONTEND_VERSION-$BACKEND_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: ./sponsoredTransactionsAuction/Dockerfile
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tag }}
53 changes: 53 additions & 0 deletions .github/workflows/release-euroe-demo-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 euroe demo dApp to
abizjak marked this conversation as resolved.
Show resolved Hide resolved
# the dockerhub image repository.
name: Create and publish a Docker image for the euroe demo dApp.

on:
workflow_dispatch: # allows manual trigger

push:
tags:
- 'euroe-demo/*.*.*'

env:
REGISTRY: docker.io
IMAGE_NAME: dapp-euroe-demo

jobs:
build-and-push-image:
runs-on: ubuntu-latest
environment: testnet-deployments
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
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 euroe-demo/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: ./euroe-demo
file: ./euroe-demo/scripts/Dockerfile
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tag }}
53 changes: 53 additions & 0 deletions .github/workflows/release-gallery-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 gallery dApp to
# the dockerhub image repository.
name: Create and publish a Docker image for the gallery dApp.

on:
workflow_dispatch: # allows manual trigger

push:
tags:
- 'gallery/*.*.*'

env:
REGISTRY: docker.io
IMAGE_NAME: dapp-gallery

jobs:
build-and-push-image:
runs-on: ubuntu-latest
environment: testnet-deployments
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
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 gallery/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: gallery/Dockerfile
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tag }}
53 changes: 53 additions & 0 deletions .github/workflows/release-sign-message-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 sign message dApp to
# the dockerhub image repository.
name: Create and publish a Docker image for the sign message dApp.

on:
workflow_dispatch: # allows manual trigger

push:
tags:
- 'signmessage/*.*.*'

env:
REGISTRY: docker.io
IMAGE_NAME: dapp-signmessage

jobs:
build-and-push-image:
runs-on: ubuntu-latest
environment: testnet-deployments
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
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 signMessage/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: ./signMessage
file: ./signMessage/Dockerfile
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tag }}
53 changes: 53 additions & 0 deletions .github/workflows/release-simple-age-verification-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 simple age verification dApp to
# the dockerhub image repository.
name: Create and publish a Docker image for the simple age verification dApp.

on:
workflow_dispatch: # allows manual trigger

push:
tags:
- 'simple-age-verification/*.*.*'

env:
REGISTRY: docker.io
IMAGE_NAME: dapp-simple-age-verification

jobs:
build-and-push-image:
runs-on: ubuntu-latest
environment: testnet-deployments
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
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 simpleAgeVerification/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: ./simpleAgeVerification
file: ./simpleAgeVerification/Dockerfile
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tag }}
55 changes: 55 additions & 0 deletions .github/workflows/release-sponsored-txs-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This job builds and publishes a docker image for the sponsored transactions dApp to
# the dockerhub image repository.
name: Create and publish a Docker image for the sponsored transactions dApp.

on:
workflow_dispatch: # allows manual trigger

push:
tags:
# The versioning is of the format: `frontend_version-backend_version`.
- 'sponsored-transactions/*.*.*-*.*.*'

env:
REGISTRY: docker.io
IMAGE_NAME: dapp-sponsored-txs
abizjak marked this conversation as resolved.
Show resolved Hide resolved

jobs:
build-and-push-image:
runs-on: ubuntu-latest
environment: testnet-deployments
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
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract tag from package.json
abizjak marked this conversation as resolved.
Show resolved Hide resolved
id: meta
run: |
export FRONTEND_VERSION=$(jq -r .version sponsoredTransactions/frontend/package.json)
export BACKEND_VERSION=$(yq .package.version sponsoredTransactions/backend/Cargo.toml)
export FULL_IMAGE_TAG="${{ env.REGISTRY }}/concordium/$IMAGE_NAME:$FRONTEND_VERSION-$BACKEND_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: ./sponsoredTransactions/Dockerfile
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tag }}
36 changes: 0 additions & 36 deletions gallery/Jenkinsfile

This file was deleted.

Loading
Loading