v1.3.2 #14
Workflow file for this run
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: Deploy Safe tokenlist | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
branches: | |
- main | |
env: | |
STAGING_BUCKET_NAME: ${{ secrets.STAGING_BUCKET_NAME }} | |
PROD_BUCKET_NAME: ${{ secrets.PROD_BUCKET_NAME }} | |
jobs: | |
deploy: | |
name: Deployment | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel previous runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v3 | |
- name: Configure AWS credentials | |
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: ${{ secrets.AWS_DEFAULT_REGION }} | |
- name: "Deploy to S3: Staging" | |
if: github.ref == 'refs/heads/main' | |
run: | | |
aws s3 sync src/tokens/ s3://${{ secrets.STAGING_BUCKET_NAME }}/current --delete --cache-control max-age=0,no-cache,no-store,must-revalidate | |
- name: "Package release version" | |
if: success() && startsWith(github.ref, 'refs/tags/v') | |
run: | | |
aws s3 sync src/tokens/ s3://${{ secrets.STAGING_BUCKET_NAME }}/releases/${{ github.event.release.tag_name }} --delete --cache-control max-age=0,no-cache,no-store,must-revalidate | |
- name: "Prepare production deployment flow" | |
if: success() && startsWith(github.ref, 'refs/tags/v') | |
run: bash ./scripts/github/prepare_production_deployment.sh | |
env: | |
PROD_DEPLOYMENT_HOOK_TOKEN: ${{ secrets.PROD_DEPLOYMENT_HOOK_TOKEN }} | |
PROD_DEPLOYMENT_HOOK_URL: ${{ secrets.PROD_DEPLOYMENT_HOOK_URL }} | |
VERSION_TAG: ${{ github.event.release.tag_name }} |