Skip to content

Commit

Permalink
PM-1376 - Add workflow to publish lists to S3 bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmarcou committed Mar 30, 2024
1 parent eac5de1 commit b24a96d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish network lists
on:
push:
branches: [PM-1376-add-worklow-to-publish-the-seed-list, main]
jobs:
publishing:
runs-on: minafoundation-default-runners
steps:
- name: 📥 Checkout
uses: actions/[email protected]
- name: ⚙️ Set environment variables
run: |
echo "AWS_REGION=$AWS_REGION" >> $GITHUB_ENV
echo "DEPLOYMENT_ROLE_NAME=$DEPLOYMENT_ROLE_NAME" >> $GITHUB_ENV
echo "AWS_ROLE_DURATION_SECONDS=$AWS_ROLE_DURATION_SECONDS" >> $GITHUB_ENV
- name: 🔑 Assume role
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ env.DEPLOYMENT_ROLE_NAME }}
role-session-name: ${{ env.DEPLOYMENT_ROLE_NAME }}
role-duration-seconds: ${{ env.AWS_ROLE_DURATION_SECONDS }}
- name: 📰 Publish network lists
env:
MF_SEED_LISTS_BUCKET_NAME: ${{ secrets.MF_SEED_LISTS_BUCKET_NAME }}
run: ./scripts/publish.sh "$MF_SEED_LISTS_BUCKET_NAME"
7 changes: 7 additions & 0 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -ex

MF_SEED_LISTS_BUCKET_NAME="${1}"

aws s3 sync --delete networks/ "s3://${MF_SEED_LISTS_BUCKET_NAME}/networks/"

0 comments on commit b24a96d

Please sign in to comment.