Skip to content

Commit

Permalink
Add release actions for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lassemoldrup committed Mar 26, 2024
1 parent 47b41bc commit 3b46ba1
Show file tree
Hide file tree
Showing 11 changed files with 321 additions and 178 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/release-auction-sponsored-txs-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 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:
- 'cis2-sponsored-transactions/*.*.*'

env:
REGISTRY: docker.io
IMAGE_NAME: concordium/dapp-auction-sponsored-txs

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 sponsoredTransactionAuction/frontend/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: ./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
# 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: concordium/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: concordium/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 }}
56 changes: 56 additions & 0 deletions .github/workflows/release-sign-message-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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/*.*.*'

pull_request:
branches: main

env:
REGISTRY: docker.io
IMAGE_NAME: concordium/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: concordium/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 }}
53 changes: 53 additions & 0 deletions .github/workflows/release-sponsored-txs-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 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:
- 'sponsored-transactions/*.*.*'

env:
REGISTRY: docker.io
IMAGE_NAME: concordium/dapp-sponsored-txs

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 sponsoredTransactions/frontend/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: ./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

0 comments on commit 3b46ba1

Please sign in to comment.