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

ci: add s3 upload action #224

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
56 changes: 56 additions & 0 deletions .github/workflows/upload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Injective list - Upload Files

on:
workflow_dispatch:
push:
branches:
- master

jobs:
deploy:
if: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.commits[0].message, 'generate json files') && !contains(github.event.commits[0].message, 'skip deploy') }}
name: "Trigger upload"
runs-on: ubuntu-latest
env:
## Github Actions
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
SKIP_DEPLOYMENTS: ${{ secrets.SKIP_DEPLOYMENTS }}
billyjacoby marked this conversation as resolved.
Show resolved Hide resolved


steps:
# Not entirely sure that we need this here, but it's in the deploy script so i put it here as well
- name: Sleep for 60s
if: ${{ env.SKIP_DEPLOYMENTS != 'true' }}
uses: juliangruber/sleep-action@v2.0.0
with:
time: 60s


# This is here solely for testing and running this action locally with ACT - it shouldn't be needed for running on github as the images in gh actions should already have the AWS CLI installed
- name: Install Act dependencies
if: ${{ env.ACT }}
run: |
apt-get update && apt-get install sudo -y && apt-get install wget -y && apt-get install unzip -y

- name: Install AWS if running locally
if: ${{ env.ACT }}
uses: unfor19/install-aws-cli-action@v1
with:
version: 2 # default
verbose: true # default
arch: amd64 # allowed values: amd64, arm64


- name: Checkout
uses: actions/checkout@main

- name: Setup AWS CLI
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

billyjacoby marked this conversation as resolved.
Show resolved Hide resolved
- name: Sync files to S3 bucket
run: |
aws s3 sync json s3://injective-lists/json --delete
billyjacoby marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ node_modules/
.DS_Store

data/formattedSwapRoutes.json
.secrets