Merge pull request #127 from ph4r5h4d/dependabot/go_modules/github.co… #42
Workflow file for this run
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: Dockerhub Release | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- v* | |
jobs: | |
build-scratch: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build docker image | |
run: docker build . --file Dockerfile --tag wait4it | |
- name: Logging into docker hub | |
run: echo "${{ secrets.DOCKERHUBPWD }}" | docker login --username ph4r5h4d --password-stdin | |
- name: Tag and push | |
run: | | |
IMAGE=ph4r5h4d/wait4it | |
# 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//') | |
echo $IMAGE | |
echo $VERSION | |
docker tag wait4it $IMAGE:$VERSION-scratch | |
docker tag wait4it $IMAGE:scratch | |
docker push $IMAGE:$VERSION-scratch | |
docker push $IMAGE:scratch | |
build-alpine: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build docker image | |
run: docker build . --file Dockerfile.alpine --tag wait4it | |
- name: Logging into docker hub | |
run: echo "${{ secrets.DOCKERHUBPWD }}" | docker login --username ph4r5h4d --password-stdin | |
- name: Tag and push | |
run: | | |
IMAGE=ph4r5h4d/wait4it | |
# 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//') | |
echo $IMAGE | |
echo $VERSION | |
docker tag wait4it $IMAGE:$VERSION-alpine | |
docker tag wait4it $IMAGE:alpine | |
docker tag wait4it $IMAGE:latest | |
docker push $IMAGE:$VERSION-alpine | |
docker push $IMAGE:alpine | |
docker push $IMAGE:latest |