Skip to content

Commit

Permalink
Update CD-docker_dev.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmerrell committed Aug 1, 2023
1 parent fe54188 commit e9d4f0e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/CD-docker_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: CD | Dev Docker Image

on:
push:
branches:
- "main"

jobs:
docker:
Expand All @@ -28,8 +26,17 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Determine Docker tag
id: docker-tag
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "DOCKER_TAG=dev" >> $GITHUB_ENV
else
echo "DOCKER_TAG=${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: ${{ vars.DOCKERHUB_REPO }}/${{ vars.DOCKERHUB_IMG }}:dev
tags: ${{ vars.DOCKERHUB_REPO }}/${{ vars.DOCKERHUB_IMG }}:${{ env.DOCKER_TAG }}

0 comments on commit e9d4f0e

Please sign in to comment.