Skip to content

Merge pull request #99 from ids-basecamp/development #11

Merge pull request #99 from ids-basecamp/development

Merge pull request #99 from ids-basecamp/development #11

name: Release
on:
push:
branches:
- master
- alpha
- beta
jobs:
release:
runs-on: ubuntu-latest
outputs:
new_tag_version: ${{ steps.tag_version.outputs.new_tag_version }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Dry run to get the next release version
id: tag_version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export NEXT_TAG_VERSION=$(npx semantic-release --dry-run | grep 'The next release version is' | sed -E 's/.* ([[:alnum:].\-]+)$/\1/')
echo "new_tag_version=${NEXT_TAG_VERSION}" >> $GITHUB_OUTPUT
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
publish-docker-images:
runs-on: ubuntu-latest
needs: release
if: ${{ needs.release.outputs.new_tag_version != '' }}
permissions:
contents: read
packages: write
id-token: write
strategy:
matrix:
include:
- context: "ch-app"
directory: "clearing-house-app"
dockerfile: "Dockerfile"
- context: "ch-edc"
directory: "clearing-house-edc"
dockerfile: "launchers/connector-prod/Dockerfile"
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build Docker image
env:
DOCKER_IMAGE_TAG: ${{ needs.release.outputs.new_tag_version }}
run: |
cd ${{ matrix.directory }}
docker build -t ghcr.io/${{ github.repository }}/${{ matrix.context }}:$DOCKER_IMAGE_TAG -f ${{ matrix.dockerfile }} .
- name: Push Docker image
env:
DOCKER_IMAGE_TAG: ${{ needs.release.outputs.new_tag_version }}
run: docker push ghcr.io/${{ github.repository }}/${{ matrix.context }}:$DOCKER_IMAGE_TAG