From f6569151e8a96f0a654d7b4d5a86a0c8f98f592a Mon Sep 17 00:00:00 2001 From: Abner Rizzi Date: Thu, 10 Aug 2023 07:14:22 -0300 Subject: [PATCH] test build and push --- .github/workflows/build-push-ghcr.yml | 38 +++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-push-ghcr.yml b/.github/workflows/build-push-ghcr.yml index 47e569d..522105c 100644 --- a/.github/workflows/build-push-ghcr.yml +++ b/.github/workflows/build-push-ghcr.yml @@ -1,30 +1,30 @@ -name: Build and Push Docker Image to GHCR +name: ci on: push: branches: - - main # Change this to the appropriate branch if needed + - main - gh-action jobs: - build-and-push: + docker: runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to GitHub Container Registry + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to Docker Hub uses: docker/login-action@v2 with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and Push Docker image - run: | - docker buildx create --use - docker buildx build --push -t ghcr.io/${{ github.repository }}:latest -f Dockerfile.base . + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v4 + with: + push: true + tags: user/app:latest \ No newline at end of file