Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
build: Fix Docker workflow (#80)
Browse files Browse the repository at this point in the history
Co-authored-by: oSumAtrIX <[email protected]>
  • Loading branch information
alexandreteles and oSumAtrIX authored Jun 9, 2024
1 parent 3769122 commit 2cb04fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
22 changes: 7 additions & 15 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ env:

jobs:
docker:
strategy:
fail-fast: false
matrix:
arch: [
# [use-cross, target, platform, tag]
[false, x86_64-unknown-linux-gnu, linux/amd64, latest],
[true, aarch64-unknown-linux-gnu, linux/arm64/v8, latest-arm64],
]
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -29,7 +21,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.arch[1] }}
target: aarch64-unknown-linux-gnu
override: true

- name: Setup Rust Cache
Expand All @@ -40,21 +32,21 @@ jobs:
id: rust_build
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.arch[0] }}
use-cross: true
command: build
args: --release --target ${{ matrix.arch[1] }}
args: --release --target aarch64-unknown-linux-gnu

- name: Setup QEMU
id: qemu
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
id: login
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -65,8 +57,8 @@ jobs:
with:
context: .
file: ./Dockerfile
platforms: ${{ matrix.arch[2] }}
platforms: linux/arm64/v8
cache-to: type=gha,mode=max,ignore-error=true
cache-from: type=gha
push: true
tags: 'revanced/revanced-discord-bot:${{ matrix.arch[3] }}'
tags: 'revanced/revanced-discord-bot:latest-arm64'
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:latest

COPY ./target/**/release/revanced-discord-bot /
COPY ./target/aarch64-unknown-linux-gnu/release/revanced-discord-bot /
CMD ["/revanced-discord-bot"]

0 comments on commit 2cb04fd

Please sign in to comment.