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

[DRAFT] WCCD Release flow #573

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
76 changes: 76 additions & 0 deletions .github/workflows/release-dapp-wccd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
on:
push:
# branches:
# - lma/release/wccd
tags:
- dapp-wccd/mainnet-*
- dapp-wccd/testnet-*

env:
SERVICE_NAME: 'dapp-wccd'
BASE_IMAGE: 'node:18-slim'
AWS_ROLE_TO_ASSUME: 'arn:aws:iam::192549843005:role/github_browser_wallet'

jobs:
release-docker:
runs-on: ubuntu-latest
environment: release
steps:
- name: Login to Docker Hub
if: ${{ secrets.DOCKERHUB_TOKEN }}
uses: docker/login-action@v3
with:
username: 'concordium'
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Clone repo
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
submodules: recursive

- name: Set image tag if correctly formatted
env:
TAG: ${{ github.ref_name }}
run: |
SERVICE_TAG=${TAG##${{ env.SERVICE_NAME }}/}
IFS='-' read -r ENVIRONMENT TAG_VERSION <<< "$SERVICE_TAG"
echo "FULL_IMAGE_TAG=concordium/${{ env.SERVICE_NAME }}:${TAG_VERSION}" >> $GITHUB_ENV
echo "ECR_IMAGE_TAG=192549843005.dkr.ecr.eu-west-1.amazonaws.com/concordium/${{ inputs.SERVICE_NAME }}:${TAG_VERSION}" >> $GITHUB_ENV
echo "ENVIRONMENT=$ENVIRONMENT" >> $GITHUB_ENV

- name: Check if image exist
run: |
set +e
docker manifest inspect ${{ env.FULL_IMAGE_TAG }}
EXITCODE=$?
if [ $EXITCODE -eq "0" ]; then
echo "Error: ${{ env.FULL_IMAGE_TAG }} already exist"
exit 1
fi

- name: Build and push docker image
if: ${{ secrets.DOCKERHUB_TOKEN }}
uses: docker/build-push-action@v6
with:
context: ./examples/wCCD
file: ./examples/wCCD/Dockerfile
tags: |
${{ env.FULL_IMAGE_TAG }}
${{ env.ECR_IMAGE_TAG }}
no-cache: true
push: false
build-args: |
NETWORK=${{ env.ENVIRONMENT }}
build_image=${{ env.base_image }}

# - name: Build and push Docker to ecr
# if: ${{ inputs.AWS_ROLE }}
# uses: explosion/action-ecr-publish@v1
# with:
# dockerfile: examples/wCCD/Dockerfile
# platforms: "linux/amd64"
# aws_region: "eu-west-1"
# aws_role_to_assume: ${{ inputs.AWS_ROLE }}
# aws_account_id: "192549843005"
# ecr_repo_name: "192549843005.dkr.ecr.eu-west-1.amazonaws.com/concordium/${{ inputs.SERVICE_NAME }}"
Loading