Github action to build and publish iverilog-make with make as the entrypoint.

This commit is contained in:
Thirsty2 2020-10-03 16:50:21 -07:00
parent 0e35a971ce
commit 20f4566a67
1 changed files with 10 additions and 1 deletions

View File

@ -17,6 +17,7 @@ on:
env:
# TODO: Change variable to your image's name.
IMAGE_NAME: iverilog
IMAGE_NAME_MAKE: iverilog-make
jobs:
# Push image to GitHub Packages.
@ -31,15 +32,20 @@ jobs:
- name: Build image
run: docker build --build-arg GITHUB_WORKSPACE=$GITHUB_WORKSPACE . --file Dockerfile --tag $IMAGE_NAME
- name: Build image with entrypoint make
run: docker build --build-arg GITHUB_WORKSPACE=$GITHUB_WORKSPACE --target iverilog-make . --file Dockerfile --tag $IMAGE_NAME_MAKE
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Push image
- name: Push images
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
IMAGE_ID_MAKE=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME_MAKE
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
IMAGE_ID_MAKE=$(echo $IMAGE_ID_MAKE | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
@ -55,3 +61,6 @@ jobs:
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
docker tag $IMAGE_ID_MAKE $IMAGE_ID_MAKE:$VERSION
docker push $IMAGE_ID_MAKE:$VERSION