mirror of
https://github.com/revanced/revanced-discord-bot.git
synced 2025-04-29 22:14:28 +02:00
build: Fix Docker workflow (#80)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
parent
3769122858
commit
2cb04fdd63
22
.github/workflows/docker.yml
vendored
22
.github/workflows/docker.yml
vendored
@ -10,14 +10,6 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
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
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -29,7 +21,7 @@ jobs:
|
|||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
target: ${{ matrix.arch[1] }}
|
target: aarch64-unknown-linux-gnu
|
||||||
override: true
|
override: true
|
||||||
|
|
||||||
- name: Setup Rust Cache
|
- name: Setup Rust Cache
|
||||||
@ -40,13 +32,13 @@ jobs:
|
|||||||
id: rust_build
|
id: rust_build
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
use-cross: ${{ matrix.arch[0] }}
|
use-cross: true
|
||||||
command: build
|
command: build
|
||||||
args: --release --target ${{ matrix.arch[1] }}
|
args: --release --target aarch64-unknown-linux-gnu
|
||||||
|
|
||||||
- name: Setup QEMU
|
- name: Setup QEMU
|
||||||
id: qemu
|
id: qemu
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
- name: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
@ -54,7 +46,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
id: login
|
id: login
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
@ -65,8 +57,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
platforms: ${{ matrix.arch[2] }}
|
platforms: linux/arm64/v8
|
||||||
cache-to: type=gha,mode=max,ignore-error=true
|
cache-to: type=gha,mode=max,ignore-error=true
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
push: true
|
push: true
|
||||||
tags: 'revanced/revanced-discord-bot:${{ matrix.arch[3] }}'
|
tags: 'revanced/revanced-discord-bot:latest-arm64'
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM ubuntu:latest
|
FROM ubuntu:latest
|
||||||
|
|
||||||
COPY ./target/**/release/revanced-discord-bot /
|
COPY ./target/aarch64-unknown-linux-gnu/release/revanced-discord-bot /
|
||||||
CMD ["/revanced-discord-bot"]
|
CMD ["/revanced-discord-bot"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user