From aca0c251b8663a0de7ee7b2f7223c1d57a5706a7 Mon Sep 17 00:00:00 2001 From: Alejandro Pinar Ruiz Date: Sun, 12 Mar 2023 19:20:12 +0100 Subject: [PATCH 1/3] Github actions to push images --- .github/workflows/push-image-backend.yml | 55 +++++++++++++++++++++++ .github/workflows/push-image-frontend.yml | 53 ++++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 .github/workflows/push-image-backend.yml create mode 100644 .github/workflows/push-image-frontend.yml diff --git a/.github/workflows/push-image-backend.yml b/.github/workflows/push-image-backend.yml new file mode 100644 index 000000000..5da13bd33 --- /dev/null +++ b/.github/workflows/push-image-backend.yml @@ -0,0 +1,55 @@ +name: Build Api Server Docker Image + +on: + push: + branches: + - 'main' + - 'develop' + - 'feature/**' + tags: + - '*' + +jobs: + build_push_backend: + name: Build Api Server Docker Image + runs-on: ubuntu-20.04 + permissions: + contents: read + packages: write + + steps: + - name: Check out the repo + uses: actions/checkout@v3.3.0 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2.1.0 + with: + platforms: linux/arm64,linux/amd64 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2.5.0 + + - name: Login to Github Container Registry + uses: docker/login-action@v2.1.0 + with: + registry: "ghcr.io" + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4.3.0 + with: + images: ghcr.io/${{ github.repository }}-backend + + - name: Build Api Server + uses: docker/build-push-action@v4.0.0 + with: + context: ./apiserver + file: ./apiserver/Dockerfile.api + platforms: linux/arm64,linux/amd64 + push: true + cache-from: type=gha + cache-to: type=gha + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/push-image-frontend.yml b/.github/workflows/push-image-frontend.yml new file mode 100644 index 000000000..93da76109 --- /dev/null +++ b/.github/workflows/push-image-frontend.yml @@ -0,0 +1,53 @@ +name: Build Frontend Docker Image + +on: + push: + branches: + - 'main' + - 'develop' + - 'feature/**' + +jobs: + build_push_frontend: + name: Build Frontend Docker Image + runs-on: ubuntu-20.04 + permissions: + contents: read + packages: write + + steps: + - name: Check out the repo + uses: actions/checkout@v3.3.0 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2.1.0 + with: + platforms: linux/arm64,linux/amd64 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2.5.0 + + - name: Login to Github Container Registry + uses: docker/login-action@v2.1.0 + with: + registry: "ghcr.io" + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4.3.0 + with: + images: ghcr.io/${{ github.repository }}-frontend + + - name: Build Frontend Server + uses: docker/build-push-action@v4.0.0 + with: + context: . + file: ./apps/app/Dockerfile.web + platforms: linux/arm64,linux/amd64 + push: true + cache-from: type=gha + cache-to: type=gha + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From b2765d47b44fa621a5a43ab02d6e57a736d22cf4 Mon Sep 17 00:00:00 2001 From: Narayana Vadapalli Date: Mon, 13 Mar 2023 10:15:05 +0530 Subject: [PATCH 2/3] Update push-image-backend.yml --- .github/workflows/push-image-backend.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/push-image-backend.yml b/.github/workflows/push-image-backend.yml index 5da13bd33..abb833922 100644 --- a/.github/workflows/push-image-backend.yml +++ b/.github/workflows/push-image-backend.yml @@ -3,9 +3,8 @@ name: Build Api Server Docker Image on: push: branches: - - 'main' - 'develop' - - 'feature/**' + - 'master' tags: - '*' From fcd64de8af45acdefcdbb318f030fc2a652a777a Mon Sep 17 00:00:00 2001 From: Narayana Vadapalli Date: Mon, 13 Mar 2023 10:19:17 +0530 Subject: [PATCH 3/3] Update push-image-frontend.yml --- .github/workflows/push-image-frontend.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/push-image-frontend.yml b/.github/workflows/push-image-frontend.yml index 93da76109..b725c20ea 100644 --- a/.github/workflows/push-image-frontend.yml +++ b/.github/workflows/push-image-frontend.yml @@ -3,9 +3,8 @@ name: Build Frontend Docker Image on: push: branches: - - 'main' - 'develop' - - 'feature/**' + - 'master' jobs: build_push_frontend: