Skip to content

Commit 4418b2f

Browse files
committedFeb 16, 2021
Fix: private submodule cloning in GH action
Based on actions/checkout#287
1 parent d62992c commit 4418b2f

File tree

1 file changed

+32
-16
lines changed

1 file changed

+32
-16
lines changed
 

‎.github/workflows/docker.branch.yml

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,45 @@ name: docker-branch
33
on:
44
push:
55
branches:
6-
- '*' # matches every branch that doesn't contain a '/'
7-
- '*/*' # matches every branch containing a single '/'
8-
- '**' # matches every branch
9-
- '!master' # excludes master
6+
- "*" # matches every branch that doesn't contain a '/'
7+
- "*/*" # matches every branch containing a single '/'
8+
- "**" # matches every branch
9+
- "!master" # excludes master
1010

1111
jobs:
1212
main:
1313
runs-on: ubuntu-latest
1414
steps:
15-
-
16-
name: Set up QEMU
15+
- name: Set up QEMU
1716
uses: docker/setup-qemu-action@v1
18-
-
19-
name: Set up Docker Buildx
17+
18+
- name: Set up Docker Buildx
2019
uses: docker/setup-buildx-action@v1
21-
-
22-
name: Login to DockerHub
20+
21+
- name: Login to DockerHub
2322
uses: docker/login-action@v1
2423
with:
2524
username: ${{ secrets.DOCKERHUB_USERNAME }}
2625
password: ${{ secrets.DOCKERHUB_TOKEN }}
27-
- uses: actions/checkout@v2
28-
- uses: benjlevesque/short-sha@v1.2
26+
27+
- name: clone main repository
28+
uses: actions/checkout@v2
29+
30+
- name: clone submodule
31+
uses: actions/checkout@v2
32+
with:
33+
repository: chiselwright/hydejack-pro
34+
path: "#jekyll-theme-hydejack"
35+
ssh-key: ${{ secrets.SSH_KEY }}
36+
persist-credentials: true
37+
38+
- name: checkout submodule
39+
run: |
40+
git submodule init
41+
git submodule update
42+
43+
- name: short sha
44+
uses: benjlevesque/short-sha@v1.2
2945
id: short-sha
3046
with:
3147
length: 7
@@ -35,8 +51,8 @@ jobs:
3551
- run: echo $SHA
3652
env:
3753
SHA: ${{ env.SHA }}
38-
-
39-
name: Build and push
54+
55+
- name: build and push
4056
id: docker_build
4157
uses: docker/build-push-action@v2
4258
with:
@@ -45,6 +61,6 @@ jobs:
4561
build-args: |
4662
arg1=value1
4763
arg2=value2
48-
-
49-
name: Image digest
64+
65+
- name: image digest
5066
run: echo ${{ steps.docker_build.outputs.digest }}

1 commit comments

Comments
 (1)

Aschen commented on Feb 17, 2021

@Aschen

Hey @chiselwright ✋

Just saw your commit referencing the issue about cloning private submodules, instead of using SSH key you can use a personal access token

      - uses: actions/checkout@v2
        with:
          submodules: recursive
          token: ${{ secrets.ACCESS_TOKEN }}

Please sign in to comment.