Skip to content

Commit

Permalink
ci: fix docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
oknozor committed Apr 19, 2024
1 parent ca3ff26 commit ce50f14
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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"]
ENTRYPOINT ["cog-bot"]

0 comments on commit ce50f14

Please sign in to comment.