deploy-core-image #378
This file contains hidden or 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: deploy-core-image | |
on: | |
workflow_run: | |
workflows: ['build-core'] | |
types: [completed] | |
push: | |
branches: | |
- main | |
jobs: | |
ar-io-core-deployment: | |
runs-on: ubuntu-latest | |
if: > | |
(github.event_name == 'push' && github.ref == 'refs/heads/main') || | |
(github.event_name == 'workflow_run' && | |
github.event.workflow_run.conclusion == 'success' && | |
github.event.workflow_run.head_branch == 'develop') | |
permissions: | |
actions: write | |
id-token: write | |
contents: read | |
steps: | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_BUILD_INVOCATION_ROLE }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Trigger Deployment For ardrive.net | |
if: github.event.workflow_run.head_branch == 'main' | |
run: | | |
aws lambda invoke \ | |
--function-name ario-dev-deployment-trigger \ | |
--region ${{ secrets.AWS_REGION }} \ | |
--cli-binary-format raw-in-base64-out \ | |
--payload '{"event_type": "deploy-ar-io-production"}' \ | |
/dev/null | |
- name: Trigger Deployment ar-io.dev | |
if: github.event.workflow_run.head_branch == 'develop' | |
run: | | |
aws lambda invoke \ | |
--function-name ario-dev-deployment-trigger \ | |
--region ${{ secrets.AWS_REGION }} \ | |
--cli-binary-format raw-in-base64-out \ | |
--payload '{"image_sha": "${{ github.event.workflow_run.head_sha }}", "event_type": "deploy-ar-io-core"}' \ | |
/dev/null | |
# Failure notification | |
- name: Send Slack failure notification | |
if: failure() | |
env: | |
SLACK_TITLE: Core Image Deployment Failed! | |
SLACK_COLOR: danger | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
uses: rtCamp/action-slack-notify@v2 |