diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 953aa003..98730a58 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,20 +53,12 @@ jobs: if: ${{ matrix.python-version == '3.14' && github.event.head_commit.message == 'release' }} run: make publish - deploy: - runs-on: ubuntu-latest + image: if: github.ref == 'refs/heads/main' needs: - build - env: - PYTHON_ENV: ci + uses: ./.github/workflows/docker-multiarch.yml + with: + image-name: quantflow + secrets: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - FMP_API_KEY: ${{ secrets.FMP_API_KEY }} - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - name: install rops - run: | - curl -L https://raw.githubusercontent.com/quantmind/rops/main/dev/install-rops | bash - echo "$HOME/bin" >> $GITHUB_PATH diff --git a/.github/workflows/docker-multiarch.yaml b/.github/workflows/docker-multiarch.yaml new file mode 100644 index 00000000..90dfb838 --- /dev/null +++ b/.github/workflows/docker-multiarch.yaml @@ -0,0 +1,76 @@ +name: Docker Multi-arch Build + +on: + workflow_call: + inputs: + image-name: + required: true + type: string + secrets: + GITHUB_TOKEN: + required: true + +jobs: + build-amd64: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v4 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: install rops + run: | + curl -L https://raw.githubusercontent.com/quantmind/rops/main/dev/install-rops | bash + echo "$HOME/bin" >> $GITHUB_PATH + - name: build amd64 + run: rops docker build ${{ inputs.image-name }} + - name: push amd64 + run: rops docker push ${{ inputs.image-name }} --arch + + build-arm64: + runs-on: ubuntu-24.04-arm + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v4 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: install rops + run: | + curl -L https://raw.githubusercontent.com/quantmind/rops/main/dev/install-rops | bash + echo "$HOME/bin" >> $GITHUB_PATH + - name: build arm64 + run: rops docker build ${{ inputs.image-name }} + - name: push arm64 + run: rops docker push ${{ inputs.image-name }} --arch + + manifest: + needs: [build-amd64, build-arm64] + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: install rops + run: | + curl -L https://raw.githubusercontent.com/quantmind/rops/main/dev/install-rops | bash + echo "$HOME/bin" >> $GITHUB_PATH + - name: create manifest + run: rops docker manifest ${{ inputs.image-name }} diff --git a/rops.toml b/rops.toml index 8823c352..c4fcbb66 100644 --- a/rops.toml +++ b/rops.toml @@ -5,5 +5,5 @@ default_branch = "main" [docker] image_branch_tag_prefix = "branch" -image_repo_url = "quantmind/quantflow" +image_repo_url = "ghcr.io/quantmind" files_path = "dev"