From d31e1d2b99d15cfd987764a0a8426187ad76c26d Mon Sep 17 00:00:00 2001 From: silvadealmeida Date: Wed, 15 May 2024 14:01:14 +0200 Subject: [PATCH] introduce automated docker build --- .../workflows/build-and-push-dockerimage.yml | 34 +++++++++++++++++++ docker/Dockerfile | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/build-and-push-dockerimage.yml create mode 100644 docker/Dockerfile diff --git a/.github/workflows/build-and-push-dockerimage.yml b/.github/workflows/build-and-push-dockerimage.yml new file mode 100644 index 0000000..f1f66fd --- /dev/null +++ b/.github/workflows/build-and-push-dockerimage.yml @@ -0,0 +1,34 @@ +name: build and push bonares-handbook image + +on: + push: + branch: + - "retype" +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # list of Docker images to use as base name for tags + images: | + zalf/bonares-handbook + tags: | + type=ref,event=tag + - 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: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v2 + with: + push: true + file: docker/Dockerfile diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..5343fbf --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,2 @@ +FROM nginx +COPY . /usr/share/nginx/html