diff --git a/.github/workflows/deploy_ecs_stage.yaml b/.github/workflows/deploy_ecs_stage.yaml deleted file mode 100644 index 7d2a44a..0000000 --- a/.github/workflows/deploy_ecs_stage.yaml +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright 2021 ChainSafe Systems -# SPDX-License-Identifier: LGPL-3.0-only - -name: sygma/deploy/stage - -on: - push: - branches: - - main - -env: - AWS_REGION: '${{ secrets.AWS_REGION }}' - ENVIRONMENT: STAGE - AWS_STAGE: '${{ secrets.AWS_ARN }}' - REGISTRY: 'ghcr.io' - TAG: 'latest' - -jobs: - push: - name: push - runs-on: ubuntu-latest - - permissions: - contents: read - id-token: write - - steps: - - name: checkout the source code - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: login to ghcr - id: ghcr - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.repository_owner }} - password: ${{ secrets.GHCR_TOKEN }} - - - name: build / tag / push docker image into ghcr - id: build-and-push - uses: docker/build-push-action@v3 - with: - context: . - push: true - tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ env.TAG }} - - deploy: - needs: push - name: deploy - runs-on: ubuntu-latest - - permissions: - contents: read - id-token: write - - steps: - - name: checkout the source code - uses: actions/checkout@v3 - - - name: checkout ecs repo - uses: actions/checkout@v3 - with: - repository: sygmaprotocol/devops - token: ${{ secrets.GHCR_TOKEN }} - - - name: configure aws credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: arn:aws:iam::${{ env.AWS_STAGE }}:role/github-actions-${{ env.ENVIRONMENT }}-chainbridge - aws-region: ${{ env.AWS_REGION }} - role-session-name: GithubActions - - - name: deploy task definition - uses: aws-actions/amazon-ecs-deploy-task-definition@v1 - with: - task-definition: 'fee-oracle/ecs/task_definition_${{ env.ENVIRONMENT }}.json' - service: 'fee-oracle-service-${{ env.ENVIRONMENT }}' - cluster: 'fee-oracle-${{ env.ENVIRONMENT }}' - wait-for-service-stability: true diff --git a/.github/workflows/deploy_ecs_testnet.yaml b/.github/workflows/deploy_ecs_testnet.yaml deleted file mode 100644 index c96b7c8..0000000 --- a/.github/workflows/deploy_ecs_testnet.yaml +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright 2021 ChainSafe Systems -# SPDX-License-Identifier: LGPL-3.0-only - -name: sygma/deploy/testnet - -on: - release: - types: - - published - -env: - AWS_REGION: '${{ secrets.AWS_REGION }}' - ENVIRONMENT: TESTNET - AWS_STAGE: '${{ secrets.AWS_ARN }}' - REGISTRY: 'ghcr.io' - TAG: 'stable' - - -jobs: - push: - name: push - runs-on: ubuntu-latest - - permissions: - contents: read - id-token: write - - steps: - - name: checkout the source code - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: login to ghcr - id: ghcr - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.repository_owner }} - password: ${{ secrets.GHCR_TOKEN }} - - - name: build / tag / push docker image into ghcr - id: build-and-push - uses: docker/build-push-action@v3 - with: - context: . - push: true - tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ env.TAG }} - - deploy: - needs: push - name: deploy - runs-on: ubuntu-latest - - permissions: - contents: read - id-token: write - - steps: - - name: checkout the source code - uses: actions/checkout@v3 - - - name: checkout ecs repo - uses: actions/checkout@v3 - with: - repository: sygmaprotocol/devops - token: ${{ secrets.GHCR_TOKEN }} - - - name: configure aws credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: arn:aws:iam::${{ env.AWS_STAGE }}:role/github-actions-${{ env.ENVIRONMENT }}-chainbridge - aws-region: ${{ env.AWS_REGION }} - role-session-name: GithubActions - - - name: deploy task definition - uses: aws-actions/amazon-ecs-deploy-task-definition@v1 - with: - task-definition: 'fee-oracle/ecs/task_definition_${{ env.ENVIRONMENT }}.json' - service: 'fee-oracle-service-${{ env.ENVIRONMENT }}' - cluster: 'fee-oracle-${{ env.ENVIRONMENT }}' - wait-for-service-stability: true diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml deleted file mode 100644 index 83713a7..0000000 --- a/.github/workflows/docker-build-push.yml +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright 2021 ChainSafe Systems -# SPDX-License-Identifier: LGPL-3.0-only - -name: Build and publish Docker image - -on: - push: - branches: - # when main branch receives a push - - main - # when any of these versions receive a push - tags: - - "v*.*.*" - # when any releases are created - release: - types: - - created -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - -jobs: - push_to_registry: - name: Push Docker image to Docker Hub - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v3 - - - name: Prepare - id: prep - run: | - # creates local variable of docker image - - # creates local variable of commit hash that triggered workflow - COMMIT_HASH=$(echo $GITHUB_SHA | head -c7) - - # creates local variable to hold docker images - TAGS="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${COMMIT_HASH},${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" - - # check if branch/tag that triggered workflow was from tags - if [[ $GITHUB_REF == refs/tags/* ]]; then - - # set version - VERSION=${GITHUB_REF#refs/tags/} - - # append version to tags - TAGS="${TAGS},${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${VERSION}" - - fi - - # sets output of step - echo ::set-output name=tags::${TAGS} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Log in to Docker Hub - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v3 - with: - context: . - push: true - tags: ${{ steps.prep.outputs.tags }} - - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} -