deploy from stellar branch #6
This file contains hidden or 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: (Production) Build and Deploy | |
| on: | |
| push: | |
| branches: | |
| - stellar-scaffold | |
| - master | |
| paths: | |
| - "packages/ui/api/**" | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: "Branch to build from" | |
| required: true | |
| default: master | |
| type: string | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| packages: write | |
| attestations: write | |
| security-events: write | |
| env: | |
| REGISTRY: ${{ vars.DOCKER_REGISTRY }} | |
| ROLE_FOR_OIDC: "${{ secrets.ROLE_FOR_OIDC }}" | |
| ROLE_TO_ASSUME: "${{ secrets.ROLE_TO_ASSUME }}" | |
| WIZARD_ORIGIN: https://wizard.openzeppelin.com | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout Repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 | |
| - name: Set up AWS credentials via OIDC and role chaining | |
| uses: ./.github/actions/oidc | |
| with: | |
| role-for-oidc: ${{ env.ROLE_FOR_OIDC }} | |
| role-to-assume: ${{ env.ROLE_TO_ASSUME }} | |
| - name: Login to Amazon ECR | |
| uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1 | |
| - name: Build and push Stellar API Docker image | |
| uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0 | |
| id: push | |
| with: | |
| context: ./packages/ui/api/stellar | |
| file: ./packages/ui/api/stellar/Dockerfile.prod | |
| platforms: linux/amd64 | |
| push: true | |
| tags: | | |
| ${{ env.REGISTRY }}/wizard-api-prod:latest | |
| ${{ env.REGISTRY }}/wizard-api-prod:${{ github.sha }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| build-args: | | |
| WIZARD_ORIGIN=${{ env.WIZARD_ORIGIN }} | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: build-and-push | |
| env: | |
| ROLE_FOR_OIDC: "${{ secrets.ROLE_FOR_OIDC }}" | |
| ROLE_TO_ASSUME: "${{ secrets.ROLE_TO_ASSUME }}" | |
| ECS_CLUSTER: ${{ vars.ECS_PRD_CLUSTER }} | |
| ECS_SERVICE: ${{ vars.ECS_PRD_SERVICE }} | |
| AWS_REGION: ${{ vars.AWS_REGION }} | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Set up AWS credentials via OIDC and role chaining | |
| uses: ./.github/actions/oidc | |
| with: | |
| role-for-oidc: ${{ env.ROLE_FOR_OIDC }} | |
| role-to-assume: ${{ env.ROLE_TO_ASSUME }} | |
| - name: AWS ECS force new deployment | |
| run: | | |
| aws ecs update-service --cluster $ECS_CLUSTER --service $ECS_SERVICE --force-new-deployment --region $AWS_REGION |