Skip to content

Commit

Permalink
fix(stacks.api): download arm64 sops if using arm64 runner
Browse files Browse the repository at this point in the history
Signed-off-by: Braden Mars <[email protected]>
  • Loading branch information
BradenM committed Aug 5, 2023
1 parent a672d9c commit 451fe79
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 13 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ jobs:
uses: azure/setup-helm@v3
with:
version: 3.12.2
- name: Install Sops
uses: mdgreenwald/[email protected]
with:
version: 3.7.3
- name: Install AWS CLI
uses: unfor19/install-aws-cli-action@v1
if: inputs.runner == 'self-hosted'
Expand All @@ -63,7 +59,24 @@ jobs:
role-skip-session-tagging: true
role-to-assume: arn:aws:iam::${{secrets.AWS_PIPELINE_ACCOUNT_ID}}:role/GitHubActionRole
- name: Install
run: pnpm install
run: >-
echo Installing Sops...
ARCH=$(uname -m)
if [ "$ARCH" = "aarch64" ]; then
curl -L https://github.com/mozilla/sops/releases/download/v3.7.3/sops-v3.7.3.linux.arm64 -o sops
else
curl -L https://github.com/mozilla/sops/releases/download/v3.7.3/sops-v3.7.3.linux -o sops
fi
chmod 755 sops
mv sops /usr/local/bin
sops --version
pnpm install
- name: Build
run: |-
pnpm build
Expand Down Expand Up @@ -661,6 +674,9 @@ jobs:
- Assets-FileAsset6
- Assets-FileAsset7
- Assets-FileAsset8
- Assets-FileAsset9
- Assets-FileAsset10
- Assets-FileAsset11
- Assets-FileAsset15
- Assets-FileAsset16
- development-development-blueprint-Deploy
Expand Down
22 changes: 14 additions & 8 deletions packages/stacks/api/src/gh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,20 @@ class GithubCodePipeline {
})
pipelineKms.grantDecrypt(actionsRole.role)

const installCommands = ['pnpm install']
const sopsInstall = [
'echo Installing Sops...',
'ARCH=$(uname -m)',
'if [ "$ARCH" = "aarch64" ]; then',
' curl -L https://github.com/mozilla/sops/releases/download/v3.7.3/sops-v3.7.3.linux.arm64 -o sops',
'else',
' curl -L https://github.com/mozilla/sops/releases/download/v3.7.3/sops-v3.7.3.linux -o sops',
'fi',
'chmod 755 sops',
'mv sops /usr/local/bin',
'sops --version',
]

const installCommands = [...sopsInstall, 'pnpm install']

const commands = [
'pnpm build',
Expand Down Expand Up @@ -249,13 +262,6 @@ class GithubCodePipeline {
version: '3.12.2',
},
},
{
name: 'Install Sops',
uses: 'mdgreenwald/[email protected]',
with: {
version: '3.7.3',
},
},
{
name: 'Install AWS CLI',
uses: 'unfor19/install-aws-cli-action@v1',
Expand Down

0 comments on commit 451fe79

Please sign in to comment.