From 556669d3415c4f3e7604b521f2859f8709e4cf89 Mon Sep 17 00:00:00 2001 From: Kumi Date: Mon, 17 Jun 2024 19:46:15 +0200 Subject: [PATCH] feat: add Docker CI/CD workflow for automated builds Introduced a new Forgejo Actions workflow to automate the Docker image build and push process on tag creation. The workflow sets up the environment, including QEMU and Buildx, logs into Docker Hub, and pushes the built image. This improvement ensures consistent and efficient Docker image deployment. --- .forgejo/workflows/docker.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .forgejo/workflows/docker.yml diff --git a/.forgejo/workflows/docker.yml b/.forgejo/workflows/docker.yml new file mode 100644 index 0000000..d71dbf5 --- /dev/null +++ b/.forgejo/workflows/docker.yml @@ -0,0 +1,33 @@ +name: Docker CI/CD + +on: + push: + tags: + - "*" + +jobs: + docker: + name: Docker Build and Push to Docker Hub + container: + image: node:20-bookworm + steps: + - name: Install dependencies + run: | + apt update + apt install -y docker.io + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push to Docker Hub + uses: docker/build-push-action@v5 + with: + push: true + tags: | + privatecoffee/structables:latest + privatecoffee/structables:${{ env.GITHUB_REF_NAME }}