|
13 | 13 | branches:
|
14 | 14 | - master
|
15 | 15 | - conway-era
|
| 16 | + - dev-preview |
16 | 17 | push:
|
17 | 18 | branches:
|
18 | 19 | - master
|
19 | 20 | - conway-era
|
| 21 | + - dev-preview |
20 | 22 | tags:
|
21 | 23 | - '@cardano-sdk/cardano-services**'
|
22 | 24 | env:
|
|
96 | 98 | echo commit: ${{ github.sha }}
|
97 | 99 | - uses: divnix/std-action/run@main
|
98 | 100 | with: {ffBuildInstructions: true, remoteStore: "ssh-ng://eu.nixbuild.net"}
|
| 101 | + |
| 102 | + ### FIXME: |
| 103 | + ### FIXME: change all instances of `dev-preview` in `diff-to-us` back to `${{ github.ref_name }}` |
| 104 | + ### FIXME: |
| 105 | + |
| 106 | + diff-to-us: |
| 107 | + needs: images |
| 108 | + name: Comment with a Plan Diff (${{ github.ref_name }}) |
| 109 | + if: github.event_name == 'pull_request' && (github.ref_name == 'dev-preview' || github.ref_name == 'chore/LW-9879-lace-ops-to-sdk') |
| 110 | + runs-on: ubuntu-22.04 |
| 111 | + steps: |
| 112 | + - uses: actions/checkout@v4 |
| 113 | + |
| 114 | + - uses: DeterminateSystems/nix-installer-action@main |
| 115 | + |
| 116 | + - name: Configure AWS Credentials |
| 117 | + uses: aws-actions/[email protected] |
| 118 | + with: |
| 119 | + role-to-assume: ${{ env.AWS_ROLE_ARN }} |
| 120 | + aws-region: ${{ env.AWS_REGION }} |
| 121 | + |
| 122 | + - name: Generate the Diff |
| 123 | + run: | |
| 124 | + nix develop -L --command bash -c ' |
| 125 | + set -euo pipefail |
| 126 | +
|
| 127 | + nix run -L ".#[email protected]" 2&1 \ |
| 128 | + | tee plan-diff.txt |
| 129 | + ' |
| 130 | +
|
| 131 | + - name: Post Comment on the PR |
| 132 | + uses: actions/github-script@v5 |
| 133 | + with: |
| 134 | + script: | |
| 135 | + const fs = require('fs'); |
| 136 | + const output = fs.readFileSync('plan-diff.txt', 'utf8'); |
| 137 | + github.rest.issues.createComment({ |
| 138 | + issue_number: context.issue.number, |
| 139 | + owner: context.repo.owner, |
| 140 | + repo: context.repo.repo, |
| 141 | + body: output, |
| 142 | + }); |
| 143 | +
|
| 144 | +
|
| 145 | + deploy-to-us: |
| 146 | + if: github.ref_name == 'dev-preview' |
| 147 | + # TODO: if: github.ref_name == 'dev-preview' || github.ref_name == 'chore/LW-9879-lace-ops-to-sdk' |
| 148 | + needs: [images, diff-to-us] |
| 149 | + concurrency: |
| 150 | + # Only one deployment at a time per environment, and wait for the previous one to finish: |
| 151 | + group: deploy-${{ github.ref_name }} |
| 152 | + cancel-in-progress: false |
| 153 | + name: Deploy (${{ github.ref_name }}) |
| 154 | + runs-on: ubuntu-22.04 |
| 155 | + environment: |
| 156 | + name: ${{ github.ref_name }} |
| 157 | + url: https://${{ github.ref_name }}.dapps.lw.iog.io/ |
| 158 | + steps: |
| 159 | + - uses: actions/checkout@v4 |
| 160 | + |
| 161 | + - uses: DeterminateSystems/nix-installer-action@main |
| 162 | + |
| 163 | + - name: Configure AWS Credentials |
| 164 | + uses: aws-actions/[email protected] |
| 165 | + with: |
| 166 | + role-to-assume: ${{ env.AWS_ROLE_ARN }} |
| 167 | + aws-region: ${{ env.AWS_REGION }} |
| 168 | + |
| 169 | + - name: Deploy to K8s |
| 170 | + run: | |
| 171 | + echo "Will deploy ‘${{ github.sha }}’ to ‘${{ github.ref_name }}’" |
| 172 | +
|
| 173 | + nix develop -L --command bash -c ' |
| 174 | + set -euo pipefail |
| 175 | +
|
| 176 | + echo yes | nix run -L ".#helm.x86_64-linux.${{ github.ref_name }}@us-east-1.apply" |
| 177 | + ' |
0 commit comments