From ba07ffb80d7f57ab5fd18d1e8f357d7e91da9db4 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 8 Jan 2026 11:44:07 +0000 Subject: [PATCH] feat: Add GitHub Actions workflow for release automation This commit introduces a new GitHub Actions workflow to automate the creation of releases and packages for the project. The workflow is defined in `.github/workflows/release.yml` and performs the following actions: - Triggers on pushes of version tags (e.g., `v1.0.0`). - Builds and pushes Docker images for the backend and frontend services to Docker Hub. - Creates a GitHub Release with the same version tag. This automation will ensure a consistent and repeatable release process. --- .github/workflows/release.yml | 70 +++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5f7f958 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,70 @@ +name: Create Release and Package + +on: + push: + tags: + - 'v*.*.*' + +jobs: + build_and_push_backend: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push backend image + uses: docker/build-push-action@v5 + with: + context: ./eco_project/backend + file: ./eco_project/backend/Dockerfile + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/eco-backend:${{ github.ref_name }} + + build_and_push_frontend: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push frontend image + uses: docker/build-push-action@v5 + with: + context: . + file: ./eco_project/frontend/Dockerfile + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/eco-frontend:${{ github.ref_name }} + + create_release: + runs-on: ubuntu-latest + needs: [build_and_push_backend, build_and_push_frontend] + steps: + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref_name }} + release_name: Release ${{ github.ref_name }} + body: | + This release contains the Docker images for the backend and frontend. + draft: false + prerelease: false