Skip to content

Commit

Permalink
ci: also build images to arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheu committed Sep 15, 2023
1 parent 50e9635 commit c7a330c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v1
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
Expand All @@ -75,17 +75,18 @@ jobs:
docker_image: tsuru/rpaas-api
default_branch: main
tag_with_sha: "true"
- uses: docker/login-action@v1
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- uses: docker/build-push-action@v2
- uses: docker/build-push-action@v5
with:
file: ./Dockerfile.api
push: true
tags: ${{ steps.smarttag.outputs.tag }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
platforms: linux/amd64,linux/arm64

rpaas-operator-docker-image:
name: "Publish rpaas-operator image on dockerhub"
Expand All @@ -95,8 +96,8 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v1
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
Expand All @@ -109,17 +110,18 @@ jobs:
docker_image: tsuru/rpaas-operator
default_branch: main
tag_with_sha: "true"
- uses: docker/login-action@v1
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- uses: docker/build-push-action@v2
- uses: docker/build-push-action@v5
with:
file: ./Dockerfile.operator
push: true
tags: ${{ steps.smarttag.outputs.tag }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
platforms: linux/amd64,linux/arm64

rpaas-purger-docker-image:
name: "Publish rpaas-purger image on dockerhub"
Expand All @@ -129,8 +131,8 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v1
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
Expand All @@ -143,17 +145,18 @@ jobs:
docker_image: tsuru/rpaas-purger
default_branch: main
tag_with_sha: "true"
- uses: docker/login-action@v1
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- uses: docker/build-push-action@v2
- uses: docker/build-push-action@v5
with:
file: ./Dockerfile.purger
push: true
tags: ${{ steps.smarttag.outputs.tag }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
platforms: linux/amd64,linux/arm64

release:
name: "Release artifacts on github"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.api
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN set -x \
FROM alpine:3.18
COPY --from=builder /go/src/github.com/tsuru/rpaas-operator/bin/api /bin/rpaas-api
ARG gke_auth_plugin_version=0.1.1
ARG TARGETARCH=amd64
ARG TARGETARCH
RUN set -x \
&& apk add --update --no-cache curl ca-certificates \
&& curl -fsSL "https://github.com/traviswt/gke-auth-plugin/releases/download/${gke_auth_plugin_version}/gke-auth-plugin_Linux_$( [[ ${TARGETARCH} == 'amd64' ]] && echo 'x86_64' || echo ${TARGETARCH} ).tar.gz" \
Expand Down

0 comments on commit c7a330c

Please sign in to comment.