- Implemented logic to use get_dmrpp or get_dmrpp_h4 depending on th… #153
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: Push To Docker hub | |
on: | |
pull_request: | |
push: | |
tags: | |
- v* | |
branches: | |
- master | |
jobs: | |
push_to_registry: | |
name: Push Docker image to Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@v3 | |
- name: Get tag name | |
id: tag-name | |
run: | | |
if [ ${{ contains(github.ref, 'tags') }} = true ]; then | |
echo "Getting name for tag action..." | |
echo "tag_name=${{ github.ref_name }}" >> $GITHUB_OUTPUT | |
else | |
echo "Getting name for action..." | |
echo "tag_name=coverage" >> $GITHUB_OUTPUT | |
fi | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Build and push lambda Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: ${{ contains(github.ref, 'tags') }} | |
tags: ghrcdaac/dmrpp-generator:${{ steps.tag-name.outputs.tag_name }} | |
- name: Extract coverage report | |
run: | | |
mkdir coverage | |
CID=$(docker create ghrcdaac/dmrpp-generator:${{ steps.tag-name.outputs.tag_name }}) | |
docker cp "${CID}":/home/worker/build/coverage/lcov.info ./coverage | |
docker rm "${CID}" | |
- name: Coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |