-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Test docker build push | ||
|
||
on: | ||
push: | ||
branches: | ||
- docker-2 | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
cross-compile-on-macos: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Make a directory for output artifacts | ||
run: mkdir -p target/artifacts | ||
|
||
- name: install linux cross compiler | ||
run: brew tap messense/macos-cross-toolchains && | ||
brew install x86_64-unknown-linux-musl | ||
|
||
- name: Build release linux x86_64 binary | ||
run: rustup target install x86_64-unknown-linux-musl && | ||
make release-linux-x86_64 && | ||
mv target/x86_64-unknown-linux-musl/release-github/rqbit target/artifacts/rqbit-linux-static-x86_64 | ||
|
||
- name: Archive the binary artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: rqbit-linux-static-x86_64 | ||
path: output/rqbit-linux-static-x86_64 | ||
|
||
build-push-docker: | ||
runs-on: ubuntu-latest | ||
needs: cross-compile-on-macos | ||
steps: | ||
- name: Download a single artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: rqbit-linux-static-x86_64 | ||
path: target/x86_64/rqbit | ||
|
||
- name: chmod +x | ||
run: chmod +x target/x86_64/rqbit | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
tags: ikatson/rqbit:${{ GITHUB_REF_NAME }} | ||
context: target/x86_64/ | ||
platforms: linux/amd64 | ||
file: docker/Dockerfile |
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