Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A0-3232: Added automatic upstream merge job #51

Merged
merged 5 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/automatic-upstream-merge-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Automatic upstream merge

on:
# run on 1th and 15th day of any month, ie fortnightly
schedule:
- cron: '1 0 1,15 * *'

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
main:
name: Merge paritytech/polkadot-staking-dashboard
runs-on: ubuntu-20.04
steps:
- name: Checkout source code
uses: actions/checkout@v3

- name: Merge upstream repo
uses: Cardinal-Cryptography/github-actions/test-upstream-merge@v3
with:
target-repo: Cardinal-Cryptography/aleph-zero-dashboard
target-branch: master
upstream-repo-url: https://github.com/paritytech/polkadot-staking-dashboard
upstream-branch: main
slack-webhook-url: ${{ secrets.SLACK_INCOMING_WEBHOOK_DEV_ONDUTY }}
git-commit-author: ${{ secrets.AUTOCOMMIT_AUTHOR }}
git-commit-email: ${{ secrets.AUTOCOMMIT_EMAIL }}
gh-ci-token: ${{ secrets.CI_GH_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/build-and-deploy-to-devnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,21 @@ jobs:
kustomize_version: ${{ vars.KUSTOMIZE_VERSION }}
image_tag: ${{ needs.build-and-push.outputs.image_tag }}
github_token: ${{ secrets.CI_GH_TOKEN }}

slack-notification:
name: Slack notification
runs-on: ubuntu-20.04
needs: [deploy-to-devnet]
if: >
!cancelled() &&
github.event_name != 'workflow_dispatch'
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 }}
26 changes: 22 additions & 4 deletions .github/workflows/build-and-deploy-to-mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:

jobs:
build_and_push:
build-and-push:
name: Build and push
runs-on: ubuntu-20.04
environment:
Expand All @@ -24,10 +24,10 @@ jobs:
outputs:
image_tag: ${{ steps.build_mainnet.outputs.image_tag }}

deploy_to_mainnet:
deploy-to-mainnet:
name: Deploy to mainnet
runs-on: ubuntu-20.04
needs: [build_and_push]
needs: [build-and-push]
environment:
name: mainnet
steps:
Expand All @@ -40,5 +40,23 @@ jobs:
with:
environment: mainnet
kustomize_version: ${{ vars.KUSTOMIZE_VERSION }}
image_tag: ${{ needs.build_and_push.outputs.image_tag }}
image_tag: ${{ needs.build-and-push.outputs.image_tag }}
github_token: ${{ secrets.CI_GH_TOKEN }}

slack-notification:
name: Slack notification
runs-on: ubuntu-20.04
needs: [deploy-to-mainnet]
if: >
!cancelled() &&
github.event_name != 'workflow_dispatch'
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 }}
28 changes: 23 additions & 5 deletions .github/workflows/build-and-deploy-to-testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:

jobs:
build_and_push:
build-and-push:
name: Build and push
runs-on: ubuntu-20.04
environment:
Expand All @@ -24,10 +24,10 @@ jobs:
outputs:
image_tag: ${{ steps.build_testnet.outputs.image_tag }}

deploy_to_testnet:
deploy-to-testnet:
name: Deploy to testnet
runs-on: ubuntu-20.04
needs: [build_and_push]
needs: [build-and-push]
environment:
name: testnet
steps:
Expand All @@ -36,9 +36,27 @@ jobs:

- name: TESTNET | Deploy Aleph Zero Dashboard
uses: ./.github/actions/deploy
id: deploy_testnet
id: deploy-testnet
with:
environment: testnet
kustomize_version: ${{ vars.KUSTOMIZE_VERSION }}
image_tag: ${{ needs.build_and_push.outputs.image_tag }}
image_tag: ${{ needs.build-and-push.outputs.image_tag }}
github_token: ${{ secrets.CI_GH_TOKEN }}

slack-notification:
name: Slack notification
runs-on: ubuntu-20.04
needs: [deploy-to-testnet]
if: >
!cancelled() &&
github.event_name != 'workflow_dispatch'
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 }}
23 changes: 0 additions & 23 deletions .github/workflows/gh-publish.yml

This file was deleted.