From ce50f142317779cf202efe7d14e5d2f2b06adcaf Mon Sep 17 00:00:00 2001 From: Paul Delafosse Date: Fri, 19 Apr 2024 11:03:12 +0200 Subject: [PATCH] ci: fix docker build --- .github/workflows/CI.yml | 27 +++++++++++++-------------- Dockerfile | 10 +++++----- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d4d40b7..24da23d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -76,10 +76,10 @@ jobs: command: build args: --target ${{ matrix.target }} --release - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v3 with: name: ${{ matrix.target }} - path: ./target/${{ matrix.target }}/release/cocogitto_github_app + path: ./target/${{ matrix.target }}/release/cog-bot docker-build: name: Update docker multi-arch latest @@ -106,20 +106,19 @@ jobs: with: path: ~/artifacts - - run: ls ~/artifacts - - name: Copy artifacts to build dir run: | - mkdir -p target/x86_64-unknown-linux-musl/release/ - mkdir -p target/aarch64-unknown-linux-musl/release/ - mkdir -p target/armv7-unknown-linux-musleabihf/release/ - cp -r ~/artifacts/aarch64-unknown-linux-musl/* target/aarch64-unknown-linux-musl/release/ - cp -r ~/artifacts/armv7-unknown-linux-musleabihf/* target/armv7-unknown-linux-musleabihf/release/ - cp -r ~/artifacts/x86_64-unknown-linux-musl/* target/x86_64-unknown-linux-musl/release/ - chmod +x -R target/aarch64-unknown-linux-musl/release - chmod +x -R target/armv7-unknown-linux-musleabihf/release - chmod +x -R target/x86_64-unknown-linux-musl/release - working-directory: ./ + mkdir -p x86_64-unknown-linux-musl + cp -r /home/runner/artifacts/x86_64-unknown-linux-musl/cog-bot x86_64-unknown-linux-musl/cog-bot + chmod +x x86_64-unknown-linux-musl/cog-bot + + mkdir -p aarch64-unknown-linux-musl + cp -r /home/runner/artifacts/aarch64-unknown-linux-musl/cog-bot aarch64-unknown-linux-musl/cog-bot + chmod +x aarch64-unknown-linux-musl/cog-bot + + mkdir -p armv7-unknown-linux-musleabihf + cp -r /home/runner/artifacts/armv7-unknown-linux-musleabihf/cog-bot armv7-unknown-linux-musleabihf/cog-bot + chmod +x armv7-unknown-linux-musleabihf/cog-bot - if: ${{ github.ref_type == 'tag' }} name: Update multi-arch container latest diff --git a/Dockerfile b/Dockerfile index bb9c6f6..8ddd497 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ # Note that the following build needs binaries to be precompiled for the target # architectures. Use the `build-all` just recipies to build for all targets. FROM alpine as arm-builder -COPY ./target/armv7-unknown-linux-musleabihf/release/cocogitto_github_app /cocogitto_github_app +COPY ./target/armv7-unknown-linux-musleabihf/release/cog-bot /cog-bot FROM alpine as arm64-builder -COPY ./target/aarch64-unknown-linux-musl/release/cocogitto_github_app /cocogitto_github_app +COPY ./target/aarch64-unknown-linux-musl/release/cog-bot /cog-bot FROM alpine as amd64-builder -COPY ./target/x86_64-unknown-linux-musl/release/cocogitto_github_app /cocogitto_github_app +COPY ./target/x86_64-unknown-linux-musl/release/cog-bot /cog-bot FROM ${TARGETARCH}-builder AS builder @@ -18,10 +18,10 @@ RUN addgroup -S cocogitto && adduser -S cocogitto -G cocogitto USER cocogitto # Install binaries -COPY --from=builder /cocogitto_github_app /usr/bin/cocogitto_github_app +COPY --from=builder /cog-bot /usr/bin/cog-bot EXPOSE 8080 COPY ./config.example.toml ./config.toml -ENTRYPOINT ["cocogitto_github_app"] \ No newline at end of file +ENTRYPOINT ["cog-bot"] \ No newline at end of file