Skip to content

Commit aa04fa8

Browse files
committed
fix: ci push logic, volare syntax
1 parent 7d50b59 commit aa04fa8

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

.github/actions/docker_build/action.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@ inputs:
55
description: "The Docker architecture/platform to build for"
66
required: true
77
default: "amd64"
8-
dockerhub_user:
9-
description: The input dockerhub user
8+
container_registry:
9+
description: Container registry
10+
required: true
11+
default: "ghcr.io"
12+
container_registry_user:
13+
description: Container registry user
1014
required: false
1115
default: ""
12-
dockerhub_password:
13-
description: The input dockerhub password
16+
container_registry_password:
17+
description: Container registry password or token
1418
required: false
1519
default: ""
1620
tool_repository:
@@ -27,15 +31,15 @@ runs:
2731
- name: Check If Going To Push An Image To Docker
2832
shell: bash
2933
run: |
30-
export PUSHING=$(ruby -e 'if ("${{ github.event_name }}" != "pull_request" && "${{ inputs.dockerhub_user }}" != ""); print(1) else print(0) end')
34+
export PUSHING=$(ruby -e 'if ("${{ github.event_name }}" != "pull_request" && "${{ inputs.container_registry_user }}" != ""); print(1) else print(0) end')
3135
echo "PUSHING=$PUSHING" >> $GITHUB_ENV
3236
33-
- name: Login to DockerHub
34-
if: ${{ env.PUSHING == '1' }}
35-
uses: docker/login-action@v1
37+
- name: Login to Container Registry
38+
uses: docker/login-action@v3
3639
with:
37-
username: ${{ inputs.dockerhub_user }}
38-
password: ${{ inputs.dockerhub_password }}
40+
registry: ${{ inputs.container_registry }}
41+
username: ${{ inputs.container_registry_user }}
42+
password: ${{ inputs.container_registry_password }}
3943

4044
- name: Docker Build
4145
shell: bash

.github/workflows/openlane_ci.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
export OPDKS_VER="$(python3 ./dependencies/tool.py open_pdks -f commit)"
3939
ciel enable\
4040
--pdk $PDK_FAMILY\
41-
--token ${{ secrets.GITHUB_TOKEN }}\
41+
--github-token ${{ secrets.GITHUB_TOKEN }}\
4242
$OPDKS_VER
4343
4444
- name: Tarball PDK
@@ -89,6 +89,9 @@ jobs:
8989
with:
9090
arch: amd64
9191
tool_repository: ${{ vars.TOOL_DOCKER_IMAGE }}
92+
container_registry: ${{ vars.CONTAINER_REGISTRY || "ghcr.io" }}
93+
container_registry_username: ${{ vars.CR_USERNAME }}
94+
container_registry_password: ${{ secrets.CR_PASSWORD }}
9295
docker_build_arm64v8:
9396
name: Docker Build (arm64v8)
9497
runs-on: ubuntu-22.04-arm
@@ -101,6 +104,9 @@ jobs:
101104
with:
102105
arch: arm64v8
103106
tool_repository: ${{ vars.TOOL_DOCKER_IMAGE }}
107+
container_registry: ${{ vars.CONTAINER_REGISTRY || "ghcr.io" }}
108+
container_registry_username: ${{ vars.CR_USERNAME }}
109+
container_registry_password: ${{ secrets.CR_PASSWORD }}
104110
issue_regression_test:
105111
name: Regression Test (Test ${{ matrix.test }})
106112
needs: [docker_build_amd64, pdk_build, prepare_test_matrices]
@@ -228,7 +234,7 @@ jobs:
228234
# if: needs.test.result == 'success'
229235
# Ruby snippet to print 0 if this is a PR or if there is no DOCKERHUB_USER secret set, otherwise, 1
230236
run: |
231-
export PUSHING=$(ruby -e 'if ("${{ github.event_name }}" != "pull_request"); print(1) else print(0) end')
237+
export PUSHING=$(ruby -e 'if ("${{ github.event_name }}" != "pull_request" && "${{ vars.CR_USERNAME }}" != ""); print(1) else print(0) end')
232238
echo "PUSHING=$PUSHING" >> $GITHUB_ENV
233239
234240
- uses: actions/checkout@v4
@@ -287,6 +293,14 @@ jobs:
287293
tag: "${{ env.NEW_TAG }}"
288294
repo-token: "${{ secrets.BOT_TOKEN }}"
289295

296+
- name: Login to Container Registry
297+
if: ${{ env.PUSHING == '1' }}
298+
uses: docker/login-action@v3
299+
with:
300+
registry: ${{ vars.CONTAINER_REGISTRY }}
301+
username: ${{ vars.CR_USERNAME }}
302+
password: ${{ secrets.CR_PASSWORD }}
303+
290304
- name: Start Tag List
291305
if: ${{ env.PUSHING == '1' }}
292306
run: |

0 commit comments

Comments
 (0)