From 78a343850156ac5a90fc4334904c43f7498a6161 Mon Sep 17 00:00:00 2001 From: Abner Rizzi Date: Thu, 10 Aug 2023 07:09:16 -0300 Subject: [PATCH] test build and push --- .github/workflows/build-push-ghcr.yml | 29 +++++++++++++++++++++++++++ Dockerfile.base | 1 + 2 files changed, 30 insertions(+) create mode 100644 .github/workflows/build-push-ghcr.yml create mode 100644 Dockerfile.base diff --git a/.github/workflows/build-push-ghcr.yml b/.github/workflows/build-push-ghcr.yml new file mode 100644 index 0000000..0867904 --- /dev/null +++ b/.github/workflows/build-push-ghcr.yml @@ -0,0 +1,29 @@ +name: Build and Push Docker Image to GHCR + +on: + push: + branches: + - main # Change this to the appropriate branch if needed + +jobs: + build-and-push: + 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 GHCR + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GHCR_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 . diff --git a/Dockerfile.base b/Dockerfile.base new file mode 100644 index 0000000..35df96c --- /dev/null +++ b/Dockerfile.base @@ -0,0 +1 @@ +FROM alpine:3.9 \ No newline at end of file