Skip to content

Commit

Permalink
build and publish images migration (#5558)
Browse files Browse the repository at this point in the history
migrate jobs to gha
- build-linux-stable-cumulus
- build-test-parachain
- build-linux-stable
- build-test-collators
- build-malus
- build-linux-substrate
- prepare-bridges-zombienet-artifacts (might require help from zombienet
team)
- build-push-image-polkadot-parachain-debug
- build-push-image-test-parachain
- build-push-image-polkadot-debug
- build-push-image-colander
- build-push-image-malus
- build-push-image-substrate-pr
- build-push-image-bridges-zombienet-tests

see [ci_cd#1013](paritytech/ci_cd#1013)
  • Loading branch information
AndWeHaveAPlan authored Sep 4, 2024
1 parent de0b6f2 commit 778a9e4
Show file tree
Hide file tree
Showing 2 changed files with 572 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/actions/build-push-image/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: 'build and push image'
inputs:
dockerfile:
description: "dockerfile to build"
required: true
image-name:
description: ""
required: true
outputs:
branch:
description: 'Branch name for the PR'
value: ${{ steps.branch.outputs.branch }}


runs:
using: "composite"
steps:

# gcloud
# https://github.com/paritytech/ci_cd/wiki/GitHub:-Push-Docker-image-to-GCP-Registry
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
- name: "gcloud info"
shell: bash
run: "gcloud info"
- name: "Auth in gcloud registry"
shell: bash
run: "gcloud auth configure-docker europe-docker.pkg.dev --quiet"

- name: build
shell: bash
env:
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.105"
run: |
export BRANCH_NAME=${{ github.head_ref || github.ref_name }}
export DOCKER_IMAGES_VERSION=${BRANCH_NAME/\//-}
if [[ ${{ github.event_name }} == "merge_group" ]]; then export DOCKER_IMAGES_VERSION="${GITHUB_SHA::8}"; fi
docker build \
--build-arg VCS_REF="${GITHUB_SHA}" \
--build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \
--build-arg IMAGE_NAME="${{ inputs.image-name }}" \
--build-arg ZOMBIENET_IMAGE="${ZOMBIENET_IMAGE}" \
-t "${{ inputs.image-name }}:$DOCKER_IMAGES_VERSION" \
-f ${{ inputs.dockerfile }} \
.
docker push "${{ inputs.image-name }}:$DOCKER_IMAGES_VERSION"
Loading

0 comments on commit 778a9e4

Please sign in to comment.