Run on branch push #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | ||
Check failure on line 20 in .github/workflows/release-dapp-wccd.yaml GitHub Actions / .github/workflows/release-dapp-wccd.yamlInvalid workflow file
|
||
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 }}:${ENVIRONMENT}-${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 }} | ||
no-cache: true | ||
push: false | ||
build-args: | | ||
NETWORK=${{ env.ENVIRONMENT }} | ||
base_image=${{ env.base_image }} |