Skip to content

Last changes from NeonLabs #480

Last changes from NeonLabs

Last changes from NeonLabs #480

Workflow file for this run

name: Deploy image
on:
pull_request:
types: [opened, reopened, synchronize, labeled, unlabeled, ready_for_review]
repository_dispatch:
push:
branches:
- master
- develop
- '[vt][0-9].[0-9]+.[0-9x]+*'
tags:
- "*"
env:
DHUBU: ${{secrets.DHUBU}}
DHUBP: ${{secrets.DHUBP}}
IMAGE_NAME: ${{vars.IMAGE_NAME}}
PROXY_ENDPOINT: ${{vars.PROXY_ENDPOINT}}
RUN_LINK_REPO: ${{vars.RUN_LINK_REPO}}
BUILD_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-neon-evm:
runs-on: neon-evm-1
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: build docker image
run: |
python3 ./.github/workflows/deploy.py build_docker_image \
--github_sha=${GITHUB_SHA}
- name: publish image
run: |
python3 ./.github/workflows/deploy.py publish_image \
--github_sha=${GITHUB_SHA}
run-neon-evm-tests:
runs-on: test-runner
needs:
- build-neon-evm
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run tests
run: |
python3 ./.github/workflows/deploy.py run_tests \
--github_sha=${GITHUB_SHA}
trigger-proxy-tests:
runs-on: trigger-runner
needs:
- build-neon-evm
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Trigger proxy build
run: |
python3 ./.github/workflows/deploy.py trigger_proxy_action \
--github_sha=${GITHUB_SHA} \
--head_ref_branch=${{ github.head_ref }} \
--base_ref_branch=${{ github.base_ref }} \
--github_ref=${{ github.ref }} \
--token=${{secrets.GHTOKEN }} \
--is_draft=${{github.event.pull_request.draft}} \
--labels='${{ toJson(github.event.pull_request.labels.*.name) }}' \
--pr_url="${{ github.api_url }}/repos/${{ github.repository }}/issues" \
--pr_number="${{ github.event.pull_request.number }}"
finalize-image:
runs-on: neon-evm-1
needs:
- trigger-proxy-tests
- run-neon-evm-tests
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Finalize image
run: |
python3 ./.github/workflows/deploy.py finalize_image \
--head_ref_branch=${{ github.head_ref }} \
--github_ref=${GITHUB_REF} \
--github_sha=${GITHUB_SHA}
- name: Check if it version branch
id: is_version_branch
run: |
if [[ "${{ github.ref }}" =~ "refs/heads/"[vt][0-9]+\.[0-9]+\.x ]]; then
echo "value=true"
echo "value=true" >> $GITHUB_OUTPUT
else
echo "value=false"
echo "value=false" >> $GITHUB_OUTPUT
fi
- name: Send notification to slack
if: |
failure() &&
(github.ref_name == 'develop' ||
github.ref_name == 'master' ||
steps.is_version_branch.outputs.value) ||
startsWith(github.ref , 'refs/tags/')
run: |
python3 ./.github/workflows/deploy.py send_notification \
--url=${{secrets.SLACK_EVM_CHANNEL_URL}} \
--build_url=${BUILD_URL}