fix: removido new relic da pipeline #19
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: Build app base image | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- v* | |
env: | |
IMAGE_NAME_BASE: base | |
jobs: | |
push: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build the app base image | |
run: | | |
docker build docker --tag $IMAGE_NAME_BASE | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Push images to docker hub | |
run: | | |
IMAGE_ID=${{ github.repository }} | |
# Change all uppercase to lowercase | |
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | |
# 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" == "master" ] && VERSION=latest | |
echo "Pushing image $IMAGE_ID:$VERSION-base" | |
docker tag $IMAGE_NAME_BASE $IMAGE_ID:$VERSION-base | |
docker push $IMAGE_ID:$VERSION-base |