Bump System.Text.Json from 5.0.0 to 8.0.4 in /IBCQC_NetCore #72
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
name: Docker | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
# Publish `master` as Docker `latest` image. | |
branches: | |
- master | |
# Publish `v1.2.3` tags as releases. | |
tags: | |
- v* | |
env: | |
IMAGE_NAME: pqe-rpc-server | |
jobs: | |
push: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Define Docker image version | |
run: | | |
# Strip git ref prefix from version | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
# Strip "v" prefix from tag name | |
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | |
# Use Docker `latest` tag convention | |
[ "$VERSION" == "master" ] && VERSION=latest | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Build image | |
run: docker build . --file Dockerfile --tag $IMAGE_NAME:$VERSION | |
- name: Test base image | |
run: | | |
openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout server.key -out server.crt -subj "/C=US/ST=CA/O=IADB/CN=server" | |
openssl pkcs12 -export -in server.crt -inkey server.key -out server.pfx -passout pass:password | |
docker run -d -p 8443:443 -v `pwd`/server.pfx:/app/client.ironbridgeapi.com.pfx -e ASPNETCORE_URLS=https://+:443 --name $IMAGE_NAME $IMAGE_NAME:$VERSION 443 client.ironbridgeapi.com.pfx password | |
sleep 1 && nc -z -v -w5 localhost 8443 && docker stop $IMAGE_NAME | |
- name: Build test image | |
run: docker build . --file Dockerfile.test --build-arg VERSION=$VERSION --tag $IMAGE_NAME-test:$VERSION | |
- name: Log into GitHub Container Registry | |
if: github.event_name == 'push' | |
run: echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.repository_owner }} --password-stdin | |
- name: Push image to GitHub Container Registry | |
if: github.event_name == 'push' | |
run: | | |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME | |
# Change all uppercase to lowercase | |
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | |
echo IMAGE_ID=$IMAGE_ID | |
echo VERSION=$VERSION | |
docker tag $IMAGE_NAME:$VERSION $IMAGE_ID:$VERSION | |
docker tag $IMAGE_NAME-test:$VERSION $IMAGE_ID-test:$VERSION | |
docker push $IMAGE_ID:$VERSION | |
docker push $IMAGE_ID-test:$VERSION |