Merge pull request #335 from pjonsson/limit-make-parallelism #572
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: | |
push: | |
branches: [main, develop] | |
release: | |
types: [published] | |
repository_dispatch: | |
types: [udf-dispatch] | |
env: | |
DOCKER_USER: ${{secrets.DOCKER_USER}} | |
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} | |
IMAGE_NAME: force | |
jobs: | |
push: | |
name: Push image to Docker Hub | |
if: github.repository == 'davidfrantz/force' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Docker login | |
run: docker login -u $DOCKER_USER -p $DOCKER_PASSWORD | |
- name: Build image | |
run: docker build . --file Dockerfile --tag $IMAGE_NAME | |
- name: Push image | |
run: | | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | |
[ "$VERSION" == "main" ] && VERSION=latest | |
[ "$VERSION" == "develop" ] && VERSION=dev | |
echo VERSION=$VERSION | |
echo DOCKER=$DOCKER_USER/$IMAGE_NAME:$VERSION | |
docker tag $IMAGE_NAME $DOCKER_USER/$IMAGE_NAME:$VERSION | |
docker push $DOCKER_USER/$IMAGE_NAME:$VERSION |