ci-unified #35
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: ci-unified | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
paths: | |
- "ci-unified/*" | |
- ".github/workflows/ci-unified.yml" | |
workflow_dispatch: | |
env: | |
REGISTRY_PATH: "docker.io/paritytech" | |
REGISTRY_PATH_PR: "docker.io/paritypr" | |
IMAGE_NAME: "ci-unified" | |
RUST_STABLE_VERSION: "1.81.0" | |
RUST_NIGHTLY_VERSION: "2024-11-19" | |
FORKLIFT_VERSION: "0.13.2" | |
CODECOV_UPLOADER_VERSION: "v0.7.3" | |
CODECOV_CLI_VERSION: "v0.6.0" | |
DISTRO_CODENAME: "bullseye" | |
jobs: | |
Build: | |
runs-on: parity-default | |
environment: ${{ github.event_name == 'workflow_dispatch' && 'main' || null }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set vars | |
id: vars | |
run: | | |
export COMMIT_SHA=${{ github.sha }} | |
IMAGE_DATE_TAG="${COMMIT_SHA:0:8}-$(date +%Y%m%d)" | |
echo "IMAGE_DATE_TAG=${IMAGE_DATE_TAG}" >> $GITHUB_OUTPUT | |
DATESTAMP=$(date +%Y%m%d%H%M) | |
echo "DATESTAMP=${DATESTAMP}" >> $GITHUB_OUTPUT | |
echo $IMAGE_DATE_TAG $DATESTAMP | |
- name: build and push staging | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: ./.github/actions/build-push-image-selfhosted | |
with: | |
registry: ${{ env.REGISTRY_PATH_PR }} | |
image-name: ${{ env.IMAGE_NAME }} | |
registry-user: ${{ secrets.REGISTRY_USER }} | |
registry-password: ${{ secrets.REGISTRY_PASSWORD }} | |
image-tags: | | |
${{ env.REGISTRY_PATH_PR }}/${{ env.IMAGE_NAME }}:staging | |
${{ env.REGISTRY_PATH_PR }}/${{ env.IMAGE_NAME }}:staging-${{ env.DISTRO_CODENAME }}-${{ env.RUST_STABLE_VERSION }}-v${{ steps.vars.outputs.DATESTAMP }} | |
build-args: | | |
RUST_STABLE_VERSION=${{ env.RUST_STABLE_VERSION }} | |
RUST_NIGHTLY_VERSION=${{ env.RUST_NIGHTLY_VERSION }} | |
FORKLIFT_VERSION=${{ env.FORKLIFT_VERSION }} | |
CODECOV_UPLOADER_VERSION=${{ env.CODECOV_UPLOADER_VERSION }} | |
CODECOV_CLI_VERSION=${{ env.CODECOV_CLI_VERSION }} | |
DISTRO_CODENAME=${{ env.DISTRO_CODENAME }} | |
- name: build and push | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
uses: ./.github/actions/build-push-image-selfhosted | |
with: | |
registry: ${{ env.REGISTRY_PATH }} | |
image-name: ${{ env.IMAGE_NAME }} | |
registry-user: ${{ secrets.REGISTRY_USER }} | |
registry-password: ${{ secrets.REGISTRY_PASSWORD }} | |
image-tags: | | |
${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }}:${{ env.DISTRO_CODENAME }}-${{ env.RUST_STABLE_VERSION }} | |
${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }}:${{ env.DISTRO_CODENAME }}-${{ env.RUST_STABLE_VERSION }}-v${{ steps.vars.outputs.DATESTAMP }} | |
${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }}:${{ env.DISTRO_CODENAME }}-${{ env.RUST_STABLE_VERSION }}-${{ env.RUST_NIGHTLY_VERSION }} | |
${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }}:${{ env.DISTRO_CODENAME }}-${{ env.RUST_STABLE_VERSION }}-${{ env.RUST_NIGHTLY_VERSION }}-v${{ steps.vars.outputs.DATESTAMP }} | |
${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }}:latest | |
build-args: | | |
RUST_STABLE_VERSION=${{ env.RUST_STABLE_VERSION }} | |
RUST_NIGHTLY_VERSION=${{ env.RUST_NIGHTLY_VERSION }} | |
FORKLIFT_VERSION=${{ env.FORKLIFT_VERSION }} | |
CODECOV_UPLOADER_VERSION=${{ env.CODECOV_UPLOADER_VERSION }} | |
CODECOV_CLI_VERSION=${{ env.CODECOV_CLI_VERSION }} | |
DISTRO_CODENAME=${{ env.DISTRO_CODENAME }} |