From f6f8286cdb8df4fcb2aca6ad101ab2093f1074e3 Mon Sep 17 00:00:00 2001 From: Harsh Date: Fri, 7 Feb 2025 23:43:56 -0500 Subject: [PATCH] added workflow to test --- .github/workflows/docker-image.yml | 56 ++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 00000000..ed057f67 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,56 @@ +name: Build and Push Docker Images + +on: + push: + branches: + # - master + - test-branch-github-actions + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Debug Secret Access + run: | + if [ -z "${{ secrets.DOCKER_HUB_USERNAME }}" ]; then + echo "❌ DOCKER_HUB_USERNAME is NOT set!" + exit 1 + else + echo "✅ DOCKER_HUB_USERNAME is set!" + fi + + if [ -z "${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}" ]; then + echo "❌ DOCKER_HUB_ACCESS_TOKEN is NOT set!" + exit 1 + else + echo "✅ DOCKER_HUB_ACCESS_TOKEN is set!" + fi + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Build and push Clients image + uses: docker/build-push-action@v4 + with: + context: ./Clients + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/verifywise-frontend:testing + + - name: Build and push Servers image + uses: docker/build-push-action@v4 + with: + context: ./Servers + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/verifywise-backend:testing