feat: updated score calculation #120
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 Image CI: websplot" | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
env: | |
IMAGE_NAME: crawlabteam/webspot | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- uses: actions/checkout@v2 | |
- id: version | |
name: Get 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" == "main" ] && VERSION=latest | |
echo "::set-output name=version::$VERSION" | |
publish: | |
runs-on: ubuntu-latest | |
needs: [ setup ] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build image | |
run: | | |
docker build . --file Dockerfile --tag image | |
- name: Log into registry | |
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin | |
- name: Push image | |
run: | | |
IMAGE_VERSION=${{needs.setup.outputs.version}} | |
docker tag image $IMAGE_NAME:$IMAGE_VERSION | |
docker push $IMAGE_NAME:$IMAGE_VERSION |