Skip to content

Commit

Permalink
fixing build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Haken committed Dec 12, 2024
1 parent f4d5643 commit 2d0a5c8
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 19 deletions.
71 changes: 54 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,37 +79,74 @@ jobs:
file=kubectl
curl --location https://dl.k8s.io/release/v$KUBECTL/bin/linux/arm64/$file --output ${{ github.workspace }}/assets/$file
- name: Get istio
- name: Get istio helm charts
run: |
BASE=https://istio-release.storage.googleapis.com/charts
istio_deps=("base-$ISTIO.tgz" "istiod-$ISTIO.tgz" "gateway-$ISTIO.tgz" "cni-$ISTIO.tgz")
for file in ${istio_deps[@]}; do
curl --location $BASE/$file --output ${{ github.workspace }}/assets/$file
done
- name: Get AWS load balancer controller
- name: Get AWS load balancer controller helm chart
run: |
file=aws-load-balancer-controller-$LB_CONTROLLER_HELM.tgz
curl --location https://aws.github.io/eks-charts/$file --output ${{ github.workspace }}/assets/$file
- name: Pull istio container images
#- name: Pull istio container images
# run: |
# istio_containers=("istio/install-cni:$ISTIO" "istio/pilot:$ISTIO" "istio/proxyv2:$ISTIO")
# for file in ${istio_containers[@]}; do
# docker pull $file
# name=$(echo $file | cut -d '/' -f2 | cut -d ':' -f1)
# docker save $file | gzip > ${{ github.workspace }}/assets/$name.tar.gz
# done

- name: Pull install-cni container image
run: |
istio_containers=("istio/install-cni:$ISTIO" "istio/pilot:$ISTIO" "istio/proxyv2:$ISTIO")
for file in ${istio_containers[@]}; do
docker pull $file
name=$(echo $file | cut -d '/' -f2 | cut -d ':' -f1)
docker save $file | gzip > ${{ github.workspace }}/assets/$name.tar.gz
done
file="istio/install-cni:$ISTIO"
docker pull $file
name=$(echo $file | cut -d '/' -f2 | cut -d ':' -f1)
docker save $file | gzip > ${{ github.workspace }}/assets/$name.tar.gz
- name: Pull pilot container image
run: |
file="istio/pilot:$ISTIO"
docker pull $file
name=$(echo $file | cut -d '/' -f2 | cut -d ':' -f1)
docker save $file | gzip > ${{ github.workspace }}/assets/$name.tar.gz
- name: Pull proxy container image
run: |
file="istio/proxyv2:$ISTIO"
docker pull $file
name=$(echo $file | cut -d '/' -f2 | cut -d ':' -f1)
docker save $file | gzip > ${{ github.workspace }}/assets/$name.tar.gz
- name: Pull AWS container images
- name: Pull load balancer container container image
run: |
aws_containers=("eks/aws-load-balancer-controller:$LB_CONTROLLER_CONTAINER-linux_arm64" "cloudwatch-agent/cloudwatch-agent:latest")
BASE=public.ecr.aws
for file in ${aws_containers[@]}; do
docker pull $BASE/$file
name=$(echo $file | cut -d '/' -f2 | cut -d ':' -f1)
docker save $file | gzip > ${{ github.workspace }}/assets/$name.tar.gz
done
file="eks/aws-load-balancer-controller:$LB_CONTROLLER_CONTAINER-linux_arm64"
docker pull $BASE/$file
name=$(echo $file | cut -d '/' -f2 | cut -d ':' -f1)
docker save $BASE/$file | gzip > ${{ github.workspace }}/assets/$name.tar.gz
- name: Pull load balancer container container image
run: |
BASE=public.ecr.aws
file="cloudwatch-agent/cloudwatch-agent:latest"
docker pull $BASE/$file
name=$(echo $file | cut -d '/' -f2 | cut -d ':' -f1)
docker save $BASE/$file | gzip > ${{ github.workspace }}/assets/$name.tar.gz
#- name: Pull AWS container images
# run: |
# aws_containers=("eks/aws-load-balancer-controller:$LB_CONTROLLER_CONTAINER-linux_arm64" "cloudwatch-agent/cloudwatch-agent:latest")
# BASE=public.ecr.aws
# for file in ${aws_containers[@]}; do
# docker pull $BASE/$file
# name=$(echo $file | cut -d '/' -f2 | cut -d ':' -f1)
# docker save $file | gzip > ${{ github.workspace }}/assets/$name.tar.gz
# done

- name: Build arm64 web app
run: |
Expand Down Expand Up @@ -148,7 +185,7 @@ jobs:
cd ${{ github.workspace }}/app-src
dotnet publish --configuration Release --runtime linux-musl-arm64 --output ${{ github.workspace }}/app-src/output/src -p:PublishReadyToRun=true -p:PublishReadyToRunShowWarnings=true --self-contained
cd ${{ github.workspace }}/app-src/output
docker buildx build --tag $PROJECT_NAME/app:latest --platform linux/arm64 --build-arg SRC=src --file ${{ github.workspace }}/build/dockerfile .
docker buildx build --output type=docker --load --tag $PROJECT_NAME/app:latest --platform linux/arm64 --build-arg SRC=src --file ${{ github.workspace }}/build/dockerfile .
docker save $PROJECT_NAME/app:latest | gzip > ${{ github.workspace }}/assets/container.tar.gz
rm -rf ${{ github.workspace }}/app-src/output
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ env:
jobs:
latest_workflow:
runs-on: ubunti-latest
outputs:
RUN_ID: ${{ steps.get_run.outputs.RUN_ID }}
steps:
- name: get run
id: get_run
run: |
REPO=${{ github.repository_owner }}/${{ github.repository }}
WORKFLOW=build.yml
Expand All @@ -41,7 +44,7 @@ jobs:
assets:
runs-on: ubuntu-latest
needs: latest_workflow
needs: [ latest_workflow ]
steps:
- name: get_assets_artifact
uses: actions/download-artifact@v4
Expand All @@ -55,7 +58,7 @@ jobs:

workshop:
runs-on: ubuntu-latest
needs: latest_workflow
needs: [ latest_workflow ]
steps:
- name: get_workshop_artifact
uses: actions/download-artifact@v4
Expand Down

0 comments on commit 2d0a5c8

Please sign in to comment.