Skip to content

Commit

Permalink
Fix the docker image upload
Browse files Browse the repository at this point in the history
  • Loading branch information
btschwertfeger committed Jan 13, 2025
1 parent cee0b50 commit e1733a1
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 22 deletions.
33 changes: 19 additions & 14 deletions .github/workflows/_docker_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ name: Build and push Docker image

on:
workflow_call:
secrets:
DOCKER_USERNAME:
required: true
DOCKER_TOKEN:
required: true

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -55,18 +60,18 @@ jobs:
btschwertfeger/kraken-infinity-grid
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker images
id: push
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# - name: Build and push Docker images
# id: push
# uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
# with:
# context: .
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
# - name: Generate artifact attestation
# uses: actions/attest-build-provenance@v2
# with:
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
# subject-digest: ${{ steps.push.outputs.digest }}
# push-to-registry: true
17 changes: 10 additions & 7 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,20 @@ jobs:
## Upload the package GitHub's Docker registry
##
UploadDockerImage:
if: |
success()
&& github.actor == 'btschwertfeger'
&& (
(github.event_name == 'push' && github.ref == 'refs/heads/master')
|| github.event_name == 'release'
)
# if: |
# success()
# && github.actor == 'btschwertfeger'
# && (
# (github.event_name == 'push' && github.ref == 'refs/heads/master')
# || github.event_name == 'release'
# )
needs:
- Build
- Build-Doc
- Build-Docker
- CodeCov
- CodeQL
uses: ./.github/workflows/_docker_publish.yaml
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
79 changes: 79 additions & 0 deletions .github/workflows/scorecard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.

name: Scorecard supply-chain security

on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: "15 5 * * 7"
push:
branches: ["master"]

# Declare default permissions as read only.
permissions: read-all

jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
# Uncomment the permissions below if installing in a private repository.
# contents: read
# actions: read

steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
fetch-depth: 0 # IMPORTANT: otherwise the current tag does not get fetched and the build version gets worse

- name: Run analysis
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
with:
results_file: results.sarif
results_format: sarif
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
# - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecard on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
# repo_token: ${{ secrets.SCORECARD_TOKEN }}

# Public repositories:
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
publish_results: true

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: Upload artifact
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: Upload to code-scanning
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
with:
sarif_file: results.sarif
1 change: 0 additions & 1 deletion tests/integration/test_integration_GridHODL.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ async def test_integration_GridHODL( # noqa: PLR0915

# Quick re-check ... the price update should not affect any orderbook
# changes when dropping.
current_orders = instance.orderbook.get_orders().all()
for order, price, volume in zip(
instance.orderbook.get_orders().all(),
(59405.9, 58817.7, 58235.3, 57658.7, 57087.8),
Expand Down

0 comments on commit e1733a1

Please sign in to comment.