fix: discard problems when .env file doesn't exist #9
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: go_build_test | |
on: | |
push: | |
tags: [v*] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: get version | |
id: get-version | |
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | |
- name: build | |
run: docker build -f Dockerfile --tag hermes --label "runnumber=${GITHUB_RUN_ID}" . | |
- name: log in to the registry | |
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $ --password-stdin | |
- name: Deploy | |
env: | |
IMAGE_TAG: ${{ steps.get-version.outputs.VERSION }} | |
run: | | |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/hermes | |
# Change all uppercase to lowercase | |
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | |
docker tag hermes $IMAGE_ID:$IMAGE_TAG | |
docker push $IMAGE_ID:$IMAGE_TAG | |
if [[ ${{ steps.get-version.outputs.VERSION }} != *rc* ]]; then | |
docker tag $IMAGE_ID:$IMAGE_TAG $IMAGE_ID:latest | |
docker push $IMAGE_ID:latest | |
fi |