chore: generate json files - skip deploy #250
This file contains 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: 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 | |
SKIP_DEPLOYMENTS: ${{ secrets.SKIP_DEPLOYMENTS }} | |
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@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Sync files to S3 bucket | |
run: | | |
aws s3 sync json s3://injective-lists/json --delete |