Skip to content

Commit

Permalink
ci: fix workflow variables (#47)
Browse files Browse the repository at this point in the history
Signed-off-by: Grzegorz Choiński <[email protected]>
  • Loading branch information
Wallted authored Jan 27, 2024
1 parent bfbaaa3 commit 6965d7d
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ name: deploy
on:
push:
tags:
- '*.*.*'
- 'v*.*.*'

env:
IMAGE_NAME: ${{ env.IMAGE_NAME }}
IMAGE_NAME_PROXY: ${{ env.IMAGE_NAME_PROXY }}
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_PASS: ${{ secrets.DOCKER_HUB_PASS }}

jobs:
publish-dotnet:
runs-on: ubuntu-latest
Expand All @@ -15,17 +23,11 @@ jobs:
run: docker build ./Foodie --tag $IMAGE_NAME:${{github.ref_name}}

- name: Publish image
env:
IMAGE_NAME: ${{ env.IMAGE_NAME }}
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_PASS: ${{ secrets.DOCKER_HUB_PASS }}
run: |
docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASS
docker tag $IMAGE_NAME:${{github.ref_name}} $DOCKER_REGISTRY/$IMAGE_NAME:${{github.ref_name}}
docker push $DOCKER_REGISTRY/$IMAGE_NAME:${{github.ref_name}}
publish-nginx:
runs-on: ubuntu-latest

Expand All @@ -36,11 +38,6 @@ jobs:
run: docker build ./nginx -f ./nginx/Nginx.Dockerfile --tag $IMAGE_NAME_PROXY:${{github.ref_name}}

- name: Publish image
env:
IMAGE_NAME_PROXY: ${{ env.IMAGE_NAME_PROXY }}
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_PASS: ${{ secrets.DOCKER_HUB_PASS }}
run: |
docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASS
docker tag $IMAGE_NAME_PROXY:${{github.ref_name}} $DOCKER_REGISTRY/$IMAGE_NAME_PROXY:${{github.ref_name}}
Expand Down

0 comments on commit 6965d7d

Please sign in to comment.