From b4d210191cb3fb0e8666a7ef174f517a4ef34cd3 Mon Sep 17 00:00:00 2001 From: Azizi <64193693+azizi-a@users.noreply.github.com> Date: Tue, 3 Dec 2024 13:18:41 +0000 Subject: [PATCH 1/2] feat: add ci for scrypto-dev-container docker target --- .../workflows/ci-scrypto-dev-container.yml | 45 +++++++++++++++++++ .../publish-scrypto-dev-container.yml | 34 ++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 .github/workflows/ci-scrypto-dev-container.yml create mode 100644 .github/workflows/publish-scrypto-dev-container.yml diff --git a/.github/workflows/ci-scrypto-dev-container.yml b/.github/workflows/ci-scrypto-dev-container.yml new file mode 100644 index 0000000000..9bc3e2c54f --- /dev/null +++ b/.github/workflows/ci-scrypto-dev-container.yml @@ -0,0 +1,45 @@ +name: Build scrypto-dev-container image + +on: + push: + branches: + - develop + - main + - release\/* + pull_request: + +jobs: + tags: + runs-on: ubuntu-latest + outputs: + tag: ${{ steps.setup_tags.outputs.tag }} + steps: + - uses: RDXWorks-actions/checkout@main + with: + fetch-depth: 0 + - id: setup_tags + run: echo "tag=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + build-amd: + permissions: + contents: read + id-token: write + packages: write + pull-requests: write + needs: tags + uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main + with: + runs_on: gh-runner-scrypto-ubuntu-jammy-16-cores + image_registry: "docker.io" + image_organization: "radixdlt" + image_name: "private-scrypto-dev-container" + tag: ${{ needs.tags.outputs.tag }} + context: "." + dockerfile: "Dockerfile" + target: "scrypto-dev-container" + platforms: "linux/amd64" + provenance: "false" + scan_image: true + snyk_target_ref: ${{ github.ref_name }} + enable_dockerhub: false + secrets: + role_to_assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }} diff --git a/.github/workflows/publish-scrypto-dev-container.yml b/.github/workflows/publish-scrypto-dev-container.yml new file mode 100644 index 0000000000..e8c7581a68 --- /dev/null +++ b/.github/workflows/publish-scrypto-dev-container.yml @@ -0,0 +1,34 @@ +name: Publish scrypto-dev-container image + +on: + workflow_dispatch: + inputs: + image-label: + description: "Docker image label to be published" + +permissions: + packages: write + pull-requests: write + id-token: write + contents: read + +jobs: + build-amd: + uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main + with: + runs_on: ubuntu-16-cores-selfhosted + environment: "release" + image_registry: "docker.io" + image_organization: "radixdlt" + image_name: "scrypto-dev-container" + tag: ${{ inputs.image-label }} + context: "." + dockerfile: "Dockerfile" + target: "scrypto-dev-container" + platforms: "linux/amd64" + provenance: "false" + scan_image: true + snyk_target_ref: ${{ github.ref_name }} + enable_dockerhub: true + secrets: + role_to_assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }} From 9a5398065049814061c0ddb0cf33e51d53260610 Mon Sep 17 00:00:00 2001 From: muzuke <92723634+muzuke@users.noreply.github.com> Date: Thu, 26 Dec 2024 01:17:35 +0200 Subject: [PATCH 2/2] tweak: Adjust the workflow parameter name --- .github/workflows/publish-scrypto-dev-container.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-scrypto-dev-container.yml b/.github/workflows/publish-scrypto-dev-container.yml index e8c7581a68..b7963fd2d9 100644 --- a/.github/workflows/publish-scrypto-dev-container.yml +++ b/.github/workflows/publish-scrypto-dev-container.yml @@ -3,8 +3,8 @@ name: Publish scrypto-dev-container image on: workflow_dispatch: inputs: - image-label: - description: "Docker image label to be published" + docker_tag: + description: "Docker tag to be published" permissions: packages: write @@ -21,7 +21,7 @@ jobs: image_registry: "docker.io" image_organization: "radixdlt" image_name: "scrypto-dev-container" - tag: ${{ inputs.image-label }} + tag: ${{ inputs.docker_tag }} context: "." dockerfile: "Dockerfile" target: "scrypto-dev-container"