diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e264597..f40f171 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,31 +2,35 @@ name: Build binaries on: push: - branches: [ "main" ] + branches: ["main"] env: CARGO_TERM_COLOR: always jobs: build: - strategy: - matrix: - arch: - - x86_64-unknown-linux-musl - - aarch64-unknown-linux-musl runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install cross - run: cargo install cross - - name: Build - run: cross build --release --target ${{ matrix.arch }} - env: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: cup-${{ matrix.arch }} - path: ./target/${{ matrix.arch }}/release/cup + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + platforms: linux/amd64,linux/arm64 + tags: ghcr.io/sergi0g/cup:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a184d26..0c0c405 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,5 +12,4 @@ RUN cargo build --release FROM scratch COPY --from=build /cup/target/release/cup /cup -COPY --from=build /cup/target/release/cup.d /cup.d ENTRYPOINT ["/cup"] \ No newline at end of file