docker.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. name: Release Docker image
  2. on:
  3. push:
  4. branches: [main, dev]
  5. workflow_dispatch:
  6. env:
  7. CARGO_TERM_COLOR: always
  8. jobs:
  9. docker:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: Checkout
  13. id: checkout
  14. uses: actions/checkout@v4
  15. - name: Setup Rust toolchain
  16. id: rust
  17. uses: actions-rs/toolchain@v1
  18. with:
  19. toolchain: stable
  20. target: aarch64-unknown-linux-gnu
  21. override: true
  22. - name: Setup Rust Cache
  23. id: rust-cache
  24. uses: Swatinem/rust-cache@v2
  25. - name: Build
  26. id: rust_build
  27. uses: actions-rs/cargo@v1
  28. with:
  29. use-cross: true
  30. command: build
  31. args: --release --target aarch64-unknown-linux-gnu
  32. - name: Setup QEMU
  33. id: qemu
  34. uses: docker/setup-qemu-action@v3
  35. - name: Setup Docker Buildx
  36. id: buildx
  37. uses: docker/setup-buildx-action@v3
  38. - name: Login to DockerHub
  39. id: login
  40. uses: docker/login-action@v3
  41. with:
  42. username: ${{ secrets.DOCKERHUB_USERNAME }}
  43. password: ${{ secrets.DOCKERHUB_TOKEN }}
  44. - name: Build Image and Push
  45. id: docker_build
  46. uses: docker/build-push-action@v5
  47. with:
  48. context: .
  49. file: ./Dockerfile
  50. platforms: linux/arm64/v8
  51. cache-to: type=gha,mode=max,ignore-error=true
  52. cache-from: type=gha
  53. push: true
  54. tags: 'revanced/revanced-discord-bot:latest-arm64'