From 4c34e2e0891f6f28397389a85547316b5b44c1bb Mon Sep 17 00:00:00 2001 From: Mandeep Singh Date: Thu, 10 Oct 2024 19:06:52 +0530 Subject: [PATCH] Update workflow --- .github/workflows/docker-image.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 5bf8585..80842db 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -14,9 +14,14 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set current date as env variable + run: echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV + - name: Echo current date + run: echo "$NOW - env:${{ env.NOW }}" - name: Build the Docker image - run: docker build . --build-arg NEXT_PUBLIC_CONVEX_URL=${{ vars.NEXT_PUBLIC_CONVEX_URL }} --build-arg NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=${{ vars.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }} --file Dockerfile --tag ${{ secrets.DOCKER_USERNAME }}/aionair:$(date +%s) + run: | + docker build . --build-arg NEXT_PUBLIC_CONVEX_URL=${{ vars.NEXT_PUBLIC_CONVEX_URL }} --build-arg NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=${{ vars.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }} --file Dockerfile --tag ${{ secrets.DOCKER_USERNAME }}/aionair:$NOW - name: Push the Docker image run: | docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_TOKEN }} - docker push ${{ secrets.DOCKER_USERNAME }}/aionair:$(date +%s) + docker push ${{ secrets.DOCKER_USERNAME }}/aionair:$NOW