Skip to content

Commit

Permalink
Update the workflow to build separate rke-etcd-backup image for `ar…
Browse files Browse the repository at this point in the history
…m64` and `amd64`
  • Loading branch information
chiukapoor committed Oct 25, 2024
1 parent c3ac33a commit 8cae881
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,17 @@ jobs:
contents: read
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: true
matrix:
arch: [amd64, arm64]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Setup Go
uses: actions/setup-go@v5
with:
Expand All @@ -34,11 +42,14 @@ jobs:
- name: Build
run: |
./scripts/ci
env:
GOARCH: ${{ matrix.arch }}
ARCH: ${{ matrix.arch }}
- name: Upload rke-etcd-backup artifact
if: github.event_name == 'push' && github.ref_type == 'tag'
uses: actions/upload-artifact@v4
with:
name: rke-etcd-backup-${{ github.run_number }}-${{ github.run_attempt }}
name: rke-etcd-backup-${{ github.run_number }}-${{ github.run_attempt }}-${{ matrix.arch }}
path: bin/rke-etcd-backup
if-no-files-found: error
retention-days: 1
Expand All @@ -61,7 +72,7 @@ jobs:
- name: Download rke-etcd-backup artifact
uses: actions/download-artifact@v4
with:
name: rke-etcd-backup-${{ github.run_number }}-${{ github.run_attempt }}
name: rke-etcd-backup-${{ github.run_number }}-${{ github.run_attempt }}-${{ matrix.arch }}
path: .
- name: Fix permissions
run: |
Expand Down
2 changes: 1 addition & 1 deletion scripts/package
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cp ../bin/rke-etcd-backup .
cp -r ../{conf.d,cert-deployer,templates,nginx-proxy,*.sh} .

IMAGE=${REPO}/rke-tools:${TAG}
docker build --build-arg ARCH=${ARCH} -t ${IMAGE} .
docker buildx build --build-arg ARCH=${ARCH} -t ${IMAGE} --platform linux/${ARCH} .
mkdir -p ../dist
echo ${IMAGE} > ../dist/images
echo Built ${IMAGE}

0 comments on commit 8cae881

Please sign in to comment.