Skip to content

A0-2133: Remove nix/docker.nix file (#1438) #311

A0-2133: Remove nix/docker.nix file (#1438)

A0-2133: Remove nix/docker.nix file (#1438) #311

---
name: Main or release branch commit
on:
push:
branches:
- main
- 'release-*'
jobs:
check-vars-and-secrets:
name: Check vars and secrets
uses: ./.github/workflows/_check-vars-and-secrets.yml
secrets: inherit
build-production-node-and-runtime:
needs: [check-vars-and-secrets]
name: Build production node and runtime
uses: ./.github/workflows/_build-production-node-and-runtime.yml
store-production-node-and-runtime-in-mainnet-s3:
name: Store production node and runtime in Mainnet bucket
runs-on: ubuntu-20.04
needs: [build-production-node-and-runtime]
steps:
- name: Checkout aleph-node source code
uses: actions/checkout@v4
- name: Store production node and runtime
uses: ./.github/actions/store-node-and-runtime
with:
profile: production
aws-access-key-id: ${{ secrets.AWS_MAINNET_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_MAINNET_SECRET_ACCESS_KEY }}
aws-bucket: ${{ secrets.CI_MAINNET_S3BUCKET_NAME }}
store-production-node-and-runtime-in-devnet-s3:
name: Store production node and runtime in Devnet bucket
runs-on: ubuntu-20.04
needs: [build-production-node-and-runtime]
steps:
- name: Checkout aleph-node source code
uses: actions/checkout@v4
- name: Store production node and runtime
uses: ./.github/actions/store-node-and-runtime
with:
profile: production
aws-access-key-id: ${{ secrets.AWS_DEVNET_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DEVNET_SECRET_ACCESS_KEY }}
aws-bucket: ${{ secrets.CI_DEVNET_S3BUCKET_NAME }}
push-node-image-to-ecr:
name: Push node docker image to the ECR
needs: [build-production-node-and-runtime]
runs-on: ubuntu-20.04
steps:
- name: Checkout aleph-node sources
uses: actions/checkout@v4
- name: Call action get-ref-properties
id: get-ref-properties
# yamllint disable-line rule:line-length
uses: Cardinal-Cryptography/github-actions/get-ref-properties@v1
- name: Download node production binary from artifacts
uses: actions/download-artifact@v3
with:
name: aleph-production-node
path: target/release/
- name: Build production docker node image
id: build-image
run: |
chmod +x target/release/aleph-node
docker build --tag aleph-node:latest -f ./docker/Dockerfile .
- name: Login to Public Amazon ECR
id: login-public-ecr
uses: docker/login-action@v2
with:
registry: ${{ vars.ECR_PUBLIC_HOST }}
username: ${{ secrets.AWS_MAINNET_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_MAINNET_SECRET_ACCESS_KEY }}
- name: Push aleph-node image to ECR
env:
CURRENT_IMAGE: aleph-node
ECR_PUSH_IMAGE: ${{ vars.ECR_PUBLIC_REGISTRY }}aleph-node
run: |
docker tag ${{ env.CURRENT_IMAGE }} \
${{ env.ECR_PUSH_IMAGE }}:${{ steps.get-ref-properties.outputs.sha }}
docker push ${{ env.ECR_PUSH_IMAGE }}:${{ steps.get-ref-properties.outputs.sha }}
if [[ "${{ steps.get-ref-properties.outputs.branch }}" -eq "main" ]]; then
docker tag ${{ env.CURRENT_IMAGE }} ${{ env.ECR_PUSH_IMAGE }}:latest
docker push ${{ env.ECR_PUSH_IMAGE }}:latest
fi
send-slack-notification-release:
name: Send Slack notification about workflow status
runs-on: ubuntu-20.04
if: always() && startsWith(github.ref_name, 'release-')
needs: [push-node-image-to-ecr]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Send Slack message
uses: ./.github/actions/slack-notification
with:
notify-on: "always"
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_DEV_ONDUTY }}
send-slack-notification-main:
name: Send Slack notification about workflow status
runs-on: ubuntu-20.04
if: always() && github.ref_name == 'main'
needs: [push-node-image-to-ecr]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Send Slack message
uses: ./.github/actions/slack-notification
with:
notify-on: "failure"
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_DEV_ONDUTY }}