Testing docker again #7
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: 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: target/artifacts/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: | |
run-id: 10559930784 | |
name: rqbit-linux-static-x86_64 | |
github-token: ${{ github.token }} | |
- name: Move the binary to a different place | |
run: mkdir -p target/x86_64/ && mv rqbit-linux-static-x86_64 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: ${{ vars.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 |