Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: move Busola web and backend build to github actions #3124

Merged
merged 10 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/busola-backend-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Busola Backend Build

on:
push:
branches:
- main
paths:
- ".github/workflows/busola-backend-build.yml"
- "backend/**"
- "package.json"
pull_request_target:
types: [opened, edited, synchronize, reopened, ready_for_review]
paths:
- ".github/workflows/busola-backend-build.yml"
- "backend/**"
- "package.json"

permissions:
id-token: write # This is required for requesting the JWT token
contents: read # This is required for actions/checkout

jobs:
build-backend-image:
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main # Usage: kyma-project/test-infra/.github/workflows/image-builder.yml@main
with:
name: busola-backend
dockerfile: Dockerfile
context: backend
export-tags: true

6 changes: 0 additions & 6 deletions .github/workflows/busola-local-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,3 @@ jobs:
dockerfile: Dockerfile.local
context: .
export-tags: true
test-local-image:
runs-on: ubuntu-latest
needs: build-local-image
steps:
- name: Test image
run: echo "Testing images ${{ needs.build-local-image.outputs.images }}"
36 changes: 36 additions & 0 deletions .github/workflows/busola-web-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Busola Web Build

on:
push:
branches:
- main
paths:
- ".github/workflows/busola-web-build.yml"
- "public/**"
- "src/**"
- "package.json"
- "Makefile"
- "Dockerfile"
pull_request_target:
types: [opened, edited, synchronize, reopened, ready_for_review]
paths:
- ".github/workflows/busola-web-build.yml"
- "public/**"
- "src/**"
- "package.json"
- "Makefile"
- "Dockerfile"

permissions:
id-token: write # This is required for requesting the JWT token
contents: read # This is required for actions/checkout

jobs:
build-web-image:
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main # Usage: kyma-project/test-infra/.github/workflows/image-builder.yml@main
with:
name: busola-web
dockerfile: Dockerfile
context: .
export-tags: true

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ---- Base Alpine with Node ----
FROM alpine:3.20.2 AS builder
ARG TAG_default_tag
ARG default_tag

RUN apk add --update nodejs npm

Expand All @@ -17,7 +17,7 @@ ENV CI true

COPY . /app

RUN sed -i "s/version: dev/version: ${TAG_default_tag}/" public/version.yaml && make resolve validate
RUN sed -i "s/version: dev/version: ${default_tag}/" public/version.yaml && make resolve validate

RUN npm run build:docker

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ release: build-image push-image
release-local: build-image-local push-image-local

build-image:
docker build --build-arg=TAG_default_tag=$(TAG) -t $(IMG_NAME) -f Dockerfile .
docker build -t $(IMG_NAME) -f Dockerfile .

build-image-local:
docker build -t $(LOCAL_IMG_NAME) -f Dockerfile.local .
Expand Down
Loading