Skip to content

add dev.potlock.io and test-dev.potlock.io to allowed hosts #9

add dev.potlock.io and test-dev.potlock.io to allowed hosts

add dev.potlock.io and test-dev.potlock.io to allowed hosts #9

name: Testnet deploy to EC2 on Push
on:
push:
branches: [testnet]
env:
AWS_REGION: "us-east-1"
# Permission can be added at job level or workflow level
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
DeployToCodeDeploy:
runs-on: ubuntu-latest
steps:
- name: Git clone the repository
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/[email protected]
with:
role-to-assume: arn:aws:iam::471112976510:role/GitHubAction-AssumeRoleWithAction
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ env.AWS_REGION }}
- name: Generate appspec.yml for testnet
run: cp appspec-testnet.yml appspec.yml
- name: Create zip of repository
run: zip -r django-indexer-testnet.zip .
- name: Upload repository to S3
run: aws s3 cp django-indexer-testnet.zip s3://django-indexer-testnet/
- name: Create CodeDeploy Deployment
id: deploy
run: |
aws deploy create-deployment \
--application-name django-indexer-testnet \
--deployment-group-name django-indexer-testnet-group \
--deployment-config-name CodeDeployDefault.AllAtOnce \
--s3-location bucket=django-indexer-testnet,bundleType=zip,key=django-indexer-testnet.zip
# jobs:
# AssumeRoleAndCallIdentity:
# runs-on: ubuntu-latest
# steps:
# - name: Git clone the repository
# uses: actions/checkout@v3
# - name: configure aws credentials
# uses: aws-actions/[email protected]
# with:
# role-to-assume: arn:aws:iam::471112976510:role/GitHubAction-AssumeRoleWithAction
# role-session-name: GitHub_to_AWS_via_FederatedOIDC
# aws-region: ${{ env.AWS_REGION }}
# - name: Sts GetCallerIdentity
# run: |
# aws sts get-caller-identity
# - name: Generate appspec.yml for testnet
# run: cp appspec-testnet.yml appspec.yml
# - name: Verify appspec.yml content
# run: cat appspec.yml
# - name: Create CodeDeploy Deployment
# id: deploy
# run: |
# aws deploy create-deployment \
# --application-name django-indexer-testnet \
# --deployment-group-name django-indexer-testnet-group \
# --deployment-config-name CodeDeployDefault.AllAtOnce \
# --github-location repository=${{ github.repository }},commitId=${{ github.sha }}