Merge branch 'develop' of https://github.com/davidfrantz/force into d… #355
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-debug | |
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 debug 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 --build-arg debug=enable | |
- 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-debug | |
docker tag $IMAGE_NAME $DOCKER_USER/$IMAGE_NAME:$VERSION-debug | |
docker push $DOCKER_USER/$IMAGE_NAME:$VERSION-debug |