Skip to content

Commit 0b3add3

Browse files
committed
Throw different spaghetti at GH action wall
1 parent 61b7a25 commit 0b3add3

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed

.github/workflows/push.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- uses: actions/checkout@master
9-
- name: Private Go Mod
10-
uses: ./.github/actions/make
11-
env:
12-
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
13-
with:
14-
args: vendor
9+
- name: git setup
10+
run: scripts/ci-gitsetup.sh
1511
- name: Prepare Build Environment
1612
uses: ./.github/actions/make
1713
env:
1814
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
15+
GITHUB_REF: ${{ github.ref }}
1916
with:
2017
args: github-prepare
2118
- name: Docker Login
@@ -26,4 +23,5 @@ jobs:
2623
- name: Build & Push
2724
run: scripts/ci-dockerbuildpush.sh
2825
env:
26+
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
2927
GITHUB_REF: ${{ github.ref }}

scripts/ci-dockerbuildpush.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,21 @@ set -eo pipefail
44

55
IMAGE_REF=$(echo "$GITHUB_REF" | rev | cut -d / -f 1 | rev)
66

7+
mkdir -p ~/.ssh
8+
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
9+
chmod 600 ~/.ssh/id_rsa
10+
eval "$(ssh-agent -s)" > /dev/null 2>&1
11+
ssh-add ~/.ssh/id_rsa > /dev/null 2>&1
12+
13+
export GOPATH=${HOME}/go
14+
15+
go mod download
16+
17+
mkdir -p ${GOPATH}/bin
18+
19+
export PATH="${GOPATH}/bin:${PATH}"
20+
21+
make vendor
22+
723
docker build -t quorumcontrol/tupelo-go-sdk:${IMAGE_REF} .
824
docker push quorumcontrol/tupelo-go-sdk:${IMAGE_REF}

scripts/ci-gitsetup.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
3+
set -eo pipefail
4+
5+
git config --global url."ssh://[email protected]/".insteadOf "https://github.com/"
6+
7+
mkdir -p ~/.ssh
8+
ssh-keyscan -t rsa github.com > github.pub
9+
diff <(ssh-keygen -lf github.pub) <(echo "2048 SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8 github.com (RSA)")
10+
cat github.pub >> ~/.ssh/known_hosts
11+
rm -f github.pub

0 commit comments

Comments
 (0)