Skip to content

feat: Use Pylon client in the miner and update in the validator #87

feat: Use Pylon client in the miner and update in the validator

feat: Use Pylon client in the miner and update in the validator #87

name: "CD: miner (pre-prod)"
on:
push:
branches:
- "deploy-miner-preprod"
env:
TAG_VERSION: "v0-latest"
STAGING_DOCKER_REPO_NAME: "backenddevelopersltd/compute-horde-miner-staging"
DOCKER_REPO_NAME: "backenddevelopersltd/compute-horde-miner-preprod"
DIST_VERSION_PREFIX: "miner-preprod"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Docker build and push
run: |
IMAGE_NAME="${DOCKER_REPO_NAME}:${TAG_VERSION}"
SHA_IMAGE_NAME="${STAGING_DOCKER_REPO_NAME}:git-${GITHUB_SHA}"
docker pull "${SHA_IMAGE_NAME}"
docker image tag "${SHA_IMAGE_NAME}" "${IMAGE_NAME}"
echo "${{ secrets.DOCKERHUB_KEY }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
docker push "${IMAGE_NAME}"
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Set Dist Version
run: |
BUILD_NUMBER="${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}"
echo "DIST_VERSION=${DIST_VERSION_PREFIX}-${{ steps.date.outputs.date }}-${BUILD_NUMBER}" >> $GITHUB_ENV
- name: Create Tag
uses: actions/github-script@v6
with:
script: |
const {DIST_VERSION} = process.env
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${DIST_VERSION}`,
sha: context.sha
})
- name: Find tags for changelog
id: tags
run: |
git fetch --tags
current="${DIST_VERSION}"
previous=$(git tag -l "${DIST_VERSION_PREFIX}-*" --sort=-refname | head -2 | tail -1)
echo "current=$current" >> $GITHUB_OUTPUT
echo "previous=$previous" >> $GITHUB_OUTPUT
- name: Generate changelog
uses: ./.github/actions/generate-changelog
with:
current-tag: ${{ steps.tags.outputs.current }}
previous-tag: ${{ steps.tags.outputs.previous }}
output-file: changelog.json
project: miner
exclude-types: "chore,ci,style,build,test,doc"
triggered-by: ${{ github.triggering_actor }}
- name: Upload changelog artifact
uses: actions/upload-artifact@v4
with:
name: changelog
path: changelog.json
- name: Publish to Slack
uses: ./.github/actions/publish-changelog-to-slack
with:
changelog-file: changelog.json
message-title: "miner was just released to preprod!"
webhook-url: ${{ secrets.CHANGELOG_SLACK_WEBHOOK_URL }}