Skip to content

Commit 4cb2769

Browse files
committed
Push every commit
1 parent b5071fd commit 4cb2769

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

.github/workflows/docker-registry-publish.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ jobs:
99
steps:
1010
- name: Check out the repo
1111
uses: actions/checkout@v2
12-
- run: echo "GIT_SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
12+
- name: Set $GIT_SHORT_SHA
13+
run: echo "GIT_SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
1314
- name: Login to DockerHub
1415
uses: docker/login-action@v1
1516
with:
@@ -28,7 +29,8 @@ jobs:
2829
steps:
2930
- name: Check out the repo
3031
uses: actions/checkout@v2
31-
- run: echo "GIT_SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
32+
- name: Set $GIT_SHORT_SHA
33+
run: echo "GIT_SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
3234
- name: Login to DockerHub
3335
uses: docker/login-action@v1
3436
with:
@@ -48,7 +50,8 @@ jobs:
4850
steps:
4951
- name: Check out the repo
5052
uses: actions/checkout@v2
51-
- run: echo "GIT_SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
53+
- name: Set $GIT_SHORT_SHA
54+
run: echo "GIT_SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
5255
- name: Login to DockerHub
5356
uses: docker/login-action@v1
5457
with:

.github/workflows/github-packages-publish.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
steps:
1212
- name: Check out the repo
1313
uses: actions/checkout@v2
14+
- name: Set $GIT_SHORT_SHA
15+
run: echo "GIT_SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
1416
- name: Login to GitHub Container Registry
1517
uses: docker/login-action@v1
1618
with:
@@ -21,7 +23,7 @@ jobs:
2123
uses: docker/build-push-action@v2
2224
with:
2325
file: ./Dockerfile.docker
24-
tags: docker.pkg.github.com/msyea/github-actions-runner/ubuntu-docker
26+
tags: docker.pkg.github.com/msyea/github-actions-runner/ubuntu-docker:${{ env.GIT_SHORT_SHA }}
2527
push: true
2628
push_dind:
2729
needs: push_docker
@@ -30,37 +32,45 @@ jobs:
3032
steps:
3133
- name: Check out the repo
3234
uses: actions/checkout@v2
35+
- name: Set $GIT_SHORT_SHA
36+
run: echo "GIT_SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
3337
- name: Login to GitHub Container Registry
3438
uses: docker/login-action@v1
3539
with:
3640
registry: docker.pkg.github.com
3741
username: ${{ github.repository_owner }}
3842
password: ${{ secrets.GITHUB_TOKEN }}
39-
- run: docker pull docker.pkg.github.com/msyea/github-actions-runner/ubuntu-docker:latest
43+
- run: docker pull docker.pkg.github.com/msyea/github-actions-runner/ubuntu-docker:${{ env.GIT_SHORT_SHA }}
4044
- name: Push to GitHub
4145
uses: docker/build-push-action@v2
4246
with:
4347
file: ./Dockerfile.dind
44-
tags: docker.pkg.github.com/msyea/github-actions-runner/ubuntu-dind
48+
tags: docker.pkg.github.com/msyea/github-actions-runner/ubuntu-dind:${{ env.GIT_SHORT_SHA }}
4549
push: true
46-
build-args: REGISTRY=docker.pkg.github.com/msyea/github-actions-runner
50+
build-args: |
51+
REGISTRY=docker.pkg.github.com/msyea/github-actions-runner
52+
TAG=${{ env.GIT_SHORT_SHA }}
4753
push_gha:
4854
needs: [push_docker, push_dind]
4955
name: Push GitHub Actions runner image to GitHub
5056
runs-on: ubuntu-latest
5157
steps:
5258
- name: Check out the repo
5359
uses: actions/checkout@v2
60+
- name: Set $GIT_SHORT_SHA
61+
run: echo "GIT_SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
5462
- name: Login to GitHub Container Registry
5563
uses: docker/login-action@v1
5664
with:
5765
registry: docker.pkg.github.com
5866
username: ${{ github.repository_owner }}
5967
password: ${{ secrets.GITHUB_TOKEN }}
60-
- run: docker pull docker.pkg.github.com/msyea/github-actions-runner/ubuntu-dind:latest
68+
- run: docker pull docker.pkg.github.com/msyea/github-actions-runner/ubuntu-dind:${{ env.GIT_SHORT_SHA }}
6169
- name: Push to GitHub
6270
uses: docker/build-push-action@v2
6371
with:
64-
tags: docker.pkg.github.com/msyea/github-actions-runner/github-actions-runner
72+
tags: docker.pkg.github.com/msyea/github-actions-runner/github-actions-runner:${{ env.GIT_SHORT_SHA }}
6573
push: true
66-
build-args: REGISTRY=docker.pkg.github.com/msyea/github-actions-runner
74+
build-args: |
75+
REGISTRY=docker.pkg.github.com/msyea/github-actions-runner
76+
TAG=${{ env.GIT_SHORT_SHA }}

0 commit comments

Comments
 (0)