Skip to content

Commit

Permalink
Update docker-build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
YazdanZ authored Aug 8, 2023
1 parent b2e09c1 commit 34a5e60
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,17 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Get commit SHA
run: echo "COMMIT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV

- name: Determine image version
id: versioning
run: |
if [ -n "${GITHUB_REF##*/}" ]; then
echo "VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
else
echo "VERSION=${COMMIT_SHA}" >> $GITHUB_ENV
fi
- name: Build Docker image
run: |
IMAGE_VERSION=${VERSION}
docker build -t groundgan:$IMAGE_VERSION -f docker/Dockerfile .
docker tag groundgan:$IMAGE_VERSION groundgan:latest
docker build -t groundgan:latest -f docker/Dockerfile .
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_UNAME }}
password: ${{ secrets.DOCKER_PASS }}

- name: Print IMAGE_VERSION
run: echo "IMAGE_VERSION=${VERSION}"

- name: Push Docker image
run: |
IMAGE_VERSION=${VERSION}
# docker push yazdanz/groundgan:$IMAGE_VERSION
docker tag groundgan:latest yazdanz/groundgan:latest
docker push yazdan/groundgan:latest

0 comments on commit 34a5e60

Please sign in to comment.