From 1e7a028ded3a8234c06f92e52ed2fb7a47ccaf8d Mon Sep 17 00:00:00 2001 From: Tim Schrumpf Date: Mon, 18 Dec 2023 23:33:41 +0000 Subject: [PATCH] feat(ci): build everytime --- .github/workflows/build.yml | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a32a80d..8e2845b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,6 @@ -name: Build and Publish Docker +name: Build and Publish Container -on: - push: - branches: [ main ] +on: [ push ] jobs: build: @@ -15,15 +13,19 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build Docker image + run: | + docker buildx create --use + docker buildx inspect --bootstrap + docker buildx build --platform linux/amd64,linux/arm64 -t tillepille/diagrams::latest . - - name: Build and push - uses: docker/build-push-action@v2 - with: - context: . - push: true - tags: tillepille/diagrams:latest \ No newline at end of file + - name: Push Docker image + if: github.ref == 'refs/heads/main' + run: | + echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin + docker buildx create --use + docker buildx inspect --bootstrap + docker buildx build --platform linux/amd64,linux/arm64 -t tillepille/diagrams::latest --push . + env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}