Skip to content

Commit b3cf7f4

Browse files
committed
fix: configure SSH for private Go modules in Dockerfile and workflows
1 parent f5a6511 commit b3cf7f4

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

.github/workflows/goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Setup SSH for private modules
3030
run: |
3131
mkdir -p ~/.ssh
32-
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_rsa
32+
echo "${{ secrets.SSH_KEY_B64 }}" | base64 -d > ~/.ssh/id_rsa
3333
chmod 600 ~/.ssh/id_rsa
3434
ssh-keyscan github.com >> ~/.ssh/known_hosts
3535
# Build and push docker image

.github/workflows/pull-request.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,12 @@ jobs:
1616
- uses: actions/checkout@v2
1717
- uses: docker/setup-qemu-action@v2
1818
- uses: docker/setup-buildx-action@v2
19-
- uses: actions/cache@v3
20-
with:
21-
path: /tmp/.buildx-cache
22-
key: ${{ github.job }}-${{ runner.os }}-${{ github.event.pull_request.number }}-buildx
23-
restore-keys: |
24-
${{ github.job }}-${{ runner.os }}-${{ github.event.pull_request.number }}-buildx
2519
# Build docker image
26-
- name: Build docker image
27-
uses: docker/build-push-action@v4
28-
with:
29-
target: integration
30-
push: false
31-
cache-from: type=local,src=/tmp/.buildx-cache
32-
cache-to: type=local,dest=/tmp/.buildx-cache-new
33-
- name: Move cache
34-
if: always()
35-
run: |
36-
rm -rf /tmp/.buildx-cache
37-
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
20+
- name: Build docker image
21+
uses: docker/build-push-action@v4
22+
with:
23+
context: .
24+
target: integration
25+
push: false
26+
secrets: |
27+
ssh_key_b64=${{ secrets.SSH_KEY_B64 }}

0 commit comments

Comments
 (0)