Skip to content

Commit

Permalink
Implement build precheck (#85)
Browse files Browse the repository at this point in the history
This PR introduces a build step pre-check on GitHub actions that will be
triggered every time a new PR against develop is created.

How it
works:


1. Dev opens PR to develop
2. Skaffold build is triggered
3. If new modifications are done to the PR while its open step 2 is
re-triggered
4. After PR is merged the normal pipeline gets executed
(build+push+deploy)
5. You can't get your PR merged if the pre-check pipeline isn't green,
so it needs to finish first

To achieve this:
- New pipeline kread-skaffold-precheck.yml
- Branch protection rule at repo level

---------

Co-authored-by: Synthetics <[email protected]>
  • Loading branch information
snthtcs and Synthetics authored Nov 8, 2023
1 parent a2a6bf7 commit 7e5fe83
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 73 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/kread-skaffold-precheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Skaffold Build PR Check

on:
pull_request:
branches:
- develop
types:
- opened
- synchronize

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Install Skaffold
run: |
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
sudo install skaffold /usr/local/bin/
shell: bash

- name: Skaffold build precheck
run: |
cd frontend
export $(grep -v '^#' .env.emerynet | xargs)
envsubst < skaffold.precheck.yaml > skaffold.emerynet.yaml
skaffold build --filename skaffold.emerynet.yaml
shell: bash


13 changes: 0 additions & 13 deletions deployment/staging/workloads/config/ui-config.template.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions deployment/staging/workloads/ingresses/ui.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions deployment/staging/workloads/kustomization.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions deployment/staging/workloads/namespace/namespace.yaml

This file was deleted.

1 change: 0 additions & 1 deletion frontend/.env.staging

This file was deleted.

19 changes: 19 additions & 0 deletions frontend/skaffold.precheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: skaffold/v2beta27
kind: Config
metadata:
name: character-builder-ui
build:
tagPolicy:
sha256: {}
local:
concurrency: 0
push: false
artifacts:
- image: precheck
docker:
dockerfile: Dockerfile.ui
buildArgs:
VITE_RPC: "emerynet.rpc.agoric.net"
VITE_BRIDGE_HREF: ""
VITE_BASE_URL: "kryha.kread.dev"
VITE_NETWORK_CONFIG: "https://emerynet.agoric.net/network-config"
21 changes: 0 additions & 21 deletions frontend/skaffold.staging.template.yaml

This file was deleted.

0 comments on commit 7e5fe83

Please sign in to comment.