diff --git a/variants/github_actions_ci/workflows/ci.yml.tt b/variants/github_actions_ci/workflows/ci.yml.tt index 86481c22..ac97511e 100644 --- a/variants/github_actions_ci/workflows/ci.yml.tt +++ b/variants/github_actions_ci/workflows/ci.yml.tt @@ -138,6 +138,7 @@ jobs: # contents: read # to fetch code (actions/checkout) # with: # environment: staging + # environment_url: '<%= "https://#{TEMPLATE_CONFIG.staging_hostname}" %>' # assume_role_arn: TODO # e.g. "arn:aws:iam:::role/StagingGHARole" # aws_region: ap-southeast-2 # Sydney # secrets: @@ -155,6 +156,7 @@ jobs: # contents: read # to fetch code (actions/checkout) # with: # environment: production + # environment_url: '<%= "https://#{TEMPLATE_CONFIG.production_hostname}" %>' # assume_role_arn: TODO # e.g. "arn:aws:iam:::role/ProductionGHARole" # aws_region: ap-southeast-2 # Sydney # secrets: @@ -174,6 +176,9 @@ jobs: # uses: ./.github/workflows/deploy_to_heroku.yml # permissions: # contents: read # to fetch code (actions/checkout) + # with: + # environment: staging + # environment_url: '<%= "https://#{TEMPLATE_CONFIG.staging_hostname}" %>' # secrets: # heroku_api_key: ${{ secrets.HEROKU_API_KEY }} # heroku_email: ${{ secrets.HEROKU_EMAIL }} @@ -188,6 +193,9 @@ jobs: # uses: ./.github/workflows/deploy_to_heroku.yml # permissions: # contents: read # to fetch code (actions/checkout) + # with: + # environment: production + # environment_url: '<%= "https://#{TEMPLATE_CONFIG.production_hostname}" %>' # secrets: # heroku_api_key: ${{ secrets.HEROKU_API_KEY }} # heroku_email: ${{ secrets.HEROKU_EMAIL }} diff --git a/variants/github_actions_ci/workflows/deploy_to_ec2.yml b/variants/github_actions_ci/workflows/deploy_to_ec2.yml index 81c3d412..9ecfcc31 100644 --- a/variants/github_actions_ci/workflows/deploy_to_ec2.yml +++ b/variants/github_actions_ci/workflows/deploy_to_ec2.yml @@ -5,6 +5,9 @@ on: environment: type: string required: true + environment_url: + type: string + required: false assume_role_arn: type: string required: true @@ -44,6 +47,9 @@ jobs: name: Deploy to AWS EC2 with Capistrano, authenticated by Github OIDC runs-on: ubuntu-latest timeout-minutes: ${{ inputs.timeout_minutes }} + environment: + name: ${{ inputs.environment }} + url: ${{ inputs.environment_url }} steps: - uses: actions/checkout@v3 with: @@ -56,7 +62,7 @@ jobs: with: role-to-assume: ${{ inputs.assume_role_arn }} aws-region: ${{ inputs.aws_region }} - - name: Install SSH key for production + - name: Install SSH key uses: shimataro/ssh-key-action@v2 with: key: ${{ secrets.ssh_private_key }} diff --git a/variants/github_actions_ci/workflows/deploy_to_heroku.yml b/variants/github_actions_ci/workflows/deploy_to_heroku.yml index 1873e2a2..14bd8829 100644 --- a/variants/github_actions_ci/workflows/deploy_to_heroku.yml +++ b/variants/github_actions_ci/workflows/deploy_to_heroku.yml @@ -2,6 +2,12 @@ name: deploy_to_heroku on: workflow_call: inputs: + environment: + type: string + required: true + environment_url: + type: string + required: false timeout_minutes: type: number required: false @@ -37,11 +43,14 @@ jobs: deploy_to_heroku: runs-on: ubuntu-latest timeout-minutes: ${{ inputs.timeout_minutes }} + environment: + name: ${{ inputs.environment }} + url: ${{ inputs.environment_url }} steps: - uses: actions/checkout@v3 with: persist-credentials: true # required to push to heroku - - name: Deploy to Heroku Staging + - name: Deploy to Heroku uses: akhileshns/heroku-deploy@v3.8.9 with: heroku_api_key: ${{ secrets.heroku_api_key }}