diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..209c5c9 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,44 @@ +name: Publish to S3 + +on: + workflow_dispatch: + push: + branches: + - master + +env: + GIT_BRANCH: ${{ github.head_ref || github.ref_name }} + GIT_REPO_OWNER: ${{ github.repository_owner }} + GIT_REPO: ${{ github.repository }} + AWS_ROLE_ARN: arn:aws:iam::024848458133:role/github_oidc_FuelLabs_chain-configuration + AWS_S3_BUCKET: fuel-prod-chain-configuration-assets-origin + AWS_S3_REGION: us-east-1 + +jobs: + publish-to-s3: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ env.AWS_ROLE_ARN }} + aws-region: ${{ env.AWS_S3_REGION }} + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + + - name: Install s3cmd tool + run: pip install -r requirements.txt + + - name: Sync files to S3 + run: s3cmd --exclude '.git*' --delete-removed sync ./ s3://${{ env.AWS_S3_BUCKET }}/ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a8d610c --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +.DS_Store +.terraform +*.tfstate* +*.terraform.lock.hcl* +.vscode +.envrc +.direnv +.cov +.idea +.env diff --git a/README.md b/README.md new file mode 100644 index 0000000..7d580c7 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Fuel Chain Configuration + +This repo contains the latest Fuel Chain Configuration data. + +It is also available via CDN from https://chain-config-assets.fuel.network. diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..ac5adc0 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +s3cmd==2.4.0