Skip to content

Commit 542a2aa

Browse files
universe-opsUniverse Ops
andauthored
trying to improve build times for docker images (#184)
Improving docker builds Co-authored-by: Universe Ops <universe-ops@github.com>
1 parent 9aca265 commit 542a2aa

1 file changed

Lines changed: 82 additions & 1 deletion

File tree

.github/workflows/push.yaml

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,88 @@ jobs:
7676
run: |-
7777
git remote set-url origin https://${{ secrets.GITHUB_TOKEN }}@github.com/simple-container-com/api.git
7878
bash <(curl -Ls "https://welder.simple-container.com/welder.sh") make --timestamps
79-
bash <(curl -Ls "https://welder.simple-container.com/welder.sh") docker build --push --timestamps
79+
- name: Setup Docker Buildx with advanced caching
80+
uses: docker/setup-buildx-action@v3
81+
with:
82+
driver-opts: |
83+
image=moby/buildkit:buildx-stable-1
84+
buildkitd-flags: --allow-insecure-entitlement security.insecure
85+
- name: Docker login using SC secrets
86+
run: |
87+
${{ github.workspace }}/bin/sc stack secret-get -s dist dockerhub-cicd-token | docker login --username simplecontainer --password-stdin
88+
- name: Build and push kubectl image
89+
env:
90+
DOCKER_BUILDKIT: 1
91+
VERSION: ${{ needs.prepare.outputs.version }}
92+
run: |
93+
docker buildx build \
94+
--platform linux/amd64 \
95+
--cache-from type=gha \
96+
--cache-to type=gha,mode=max \
97+
--file kubectl.Dockerfile \
98+
--tag simplecontainer/kubectl:latest \
99+
--tag simplecontainer/kubectl:$VERSION \
100+
--push \
101+
.
102+
- name: Build and push caddy image
103+
env:
104+
DOCKER_BUILDKIT: 1
105+
VERSION: ${{ needs.prepare.outputs.version }}
106+
run: |
107+
docker buildx build \
108+
--platform linux/amd64 \
109+
--cache-from type=gha \
110+
--cache-to type=gha,mode=max \
111+
--file caddy.Dockerfile \
112+
--tag simplecontainer/caddy:latest \
113+
--tag simplecontainer/caddy:$VERSION \
114+
--push \
115+
.
116+
- name: Build and push github-actions image
117+
env:
118+
DOCKER_BUILDKIT: 1
119+
VERSION: ${{ needs.prepare.outputs.version }}
120+
run: |
121+
docker buildx build \
122+
--platform linux/amd64 \
123+
--cache-from type=gha \
124+
--cache-to type=gha,mode=max \
125+
--file github-actions.Dockerfile \
126+
--tag simplecontainer/github-actions:latest \
127+
--tag simplecontainer/github-actions:$VERSION \
128+
--push \
129+
.
130+
- name: Build and push github-actions-staging image
131+
env:
132+
DOCKER_BUILDKIT: 1
133+
run: |
134+
docker buildx build \
135+
--platform linux/amd64 \
136+
--cache-from type=gha \
137+
--cache-to type=gha,mode=max \
138+
--file github-actions-staging.Dockerfile \
139+
--tag simplecontainer/github-actions:staging \
140+
--push \
141+
.
142+
- name: Build and push cloud-helpers-aws image
143+
env:
144+
DOCKER_BUILDKIT: 1
145+
VERSION: ${{ needs.prepare.outputs.version }}
146+
run: |
147+
docker buildx build \
148+
--platform linux/amd64 \
149+
--cache-from type=gha \
150+
--cache-to type=gha,mode=max \
151+
--file cloud-helpers.aws.Dockerfile \
152+
--tag simplecontainer/cloud-helpers:aws-latest \
153+
--tag simplecontainer/cloud-helpers:aws-$VERSION \
154+
--push \
155+
.
156+
- name: Run tag-release task after images are built
157+
env:
158+
VERSION: ${{ needs.prepare.outputs.version }}
159+
run: |-
160+
bash <(curl -Ls "https://welder.simple-container.com/welder.sh") run tag-release
80161
- name: publish sc tool
81162
shell: bash
82163
env:

0 commit comments

Comments
 (0)