This repository has been archived by the owner on Aug 7, 2024. It is now read-only.
chore: Fix linter warnings #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Docker image | |
on: | |
push: | |
branches: [main, dev] | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
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 | |
id: checkout | |
uses: actions/checkout@v3 | |
- name: Setup Rust toolchain | |
id: rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.arch[1] }} | |
override: true | |
- name: Setup Rust Cache | |
id: rust-cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Build | |
id: rust_build | |
uses: actions-rs/cargo@v1 | |
with: | |
use-cross: ${{ matrix.arch[0] }} | |
command: build | |
args: --release --target ${{ matrix.arch[1] }} | |
- name: Setup QEMU | |
id: qemu | |
uses: docker/setup-qemu-action@v2 | |
- name: Setup Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
id: login | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build Image and Push | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: ${{ matrix.arch[2] }} | |
cache-to: type=gha,mode=max,ignore-error=true | |
cache-from: type=gha | |
push: true | |
tags: 'revanced/revanced-discord-bot:${{ matrix.arch[3] }}' |