diff --git a/.github/workflows/publish-dockerhub.yml b/.github/workflows/publish-dockerhub.yml index 8b379b4..5f22518 100644 --- a/.github/workflows/publish-dockerhub.yml +++ b/.github/workflows/publish-dockerhub.yml @@ -20,10 +20,18 @@ jobs: uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build the Docker image - run: docker build . --file Dockerfile --tag ${{ secrets.DOCKERHUB_USERNAME }}/devops:${{ steps.package-version.outputs.current-version}} - - - name: Docker Push - run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/devops:${{ steps.package-version.outputs.current-version}} \ No newline at end of file + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + push: true + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/devops:latest + ${{ secrets.DOCKERHUB_USERNAME }}/devops:${{ steps.package-version.outputs.current-version}} + platforms: linux/amd64,linux/arm64,linux/arm/v7 diff --git a/.github/workflows/publish-ghcr.yml b/.github/workflows/publish-ghcr.yml index 9cb46b5..b240ded 100644 --- a/.github/workflows/publish-ghcr.yml +++ b/.github/workflows/publish-ghcr.yml @@ -37,6 +37,9 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push Docker image uses: docker/build-push-action@v6 with: @@ -45,4 +48,5 @@ jobs: tags: | ghcr.io/pradumnasaraf/devops:${{ steps.package-version.outputs.current-version}} ghcr.io/pradumnasaraf/devops:latest - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + platforms: linux/amd64,linux/arm64,linux/arm/v7 + labels: ${{ steps.meta.outputs.labels }}