Skip to content

Commit

Permalink
ci: change docker login order
Browse files Browse the repository at this point in the history
  • Loading branch information
genaris committed Mar 19, 2024
1 parent 0dc379c commit f063bca
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Continuous Deployment

on:
push:
branches: [main, dev, dev-test]
branches: [main, dev]

workflow_dispatch:

Expand Down Expand Up @@ -37,10 +37,6 @@ jobs:
{
name: 'dev',
prerelease: true
},
{
name: 'dev-test',
prerelease: true
}
]
plugins: |
Expand All @@ -66,16 +62,17 @@ jobs:
"@semantic-release/release-notes-generator",
]
- run: echo ${{ steps.semantic.outputs.release-version }}

- name: Build Docker image
run: |
docker build -f Dockerfile -t $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/} .

- name: Log in to Docker Hub
if: steps.semantic.outputs.new-release-published == 'true'
run: |
echo "$DH_TOKEN" | docker login -u "$DH_USERNAME" --password-stdin
- name: Build Docker image
if: steps.semantic.outputs.new-release-published == 'true'
run: |
docker build -f Dockerfile -t $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/} .
- name: Add tags to Docker image
if: steps.semantic.outputs.new-release-published == 'true'
run: |
Expand Down

0 comments on commit f063bca

Please sign in to comment.