Skip to content

Commit c33b437

Browse files
committed
chore: gha final
1 parent 3b2ab79 commit c33b437

1 file changed

Lines changed: 37 additions & 1 deletion

File tree

.github/actions/setup-env/action.yaml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,21 @@ inputs:
99
description: Whether to setup Node.js or not.
1010
default: "true"
1111
npm-cache:
12-
description: Whether to setup npm cache or not.
12+
description: Whether to setup npm cache or not. Irrelevant if node is disabled.
1313
default: "true"
14+
docker:
15+
description: Whether to setup additional Docker build environment tools. Defaults to false.
16+
default: "false"
17+
docker-ghcr:
18+
description: Whether to login to the GitHub Container Registry or not. Defaults to false.
19+
default: "false"
20+
docker-hub:
21+
description: Whether to login to Docker Hub or not. Defaults to false.
22+
default: "false"
23+
docker-hub-username:
24+
description: Username to use to authenticate to Docker Hub.
25+
docker-hub-password:
26+
description: Password to use to authenticate to Docker Hub.
1427

1528
runs:
1629
using: composite
@@ -40,3 +53,26 @@ runs:
4053
key: cache-node-modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
4154
restore-keys: |
4255
cache-node-modules-${{ runner.os }}-
56+
57+
- name: Setup QEMU for Docker
58+
if: "${{ inputs.docker == 'true' }}"
59+
uses: docker/setup-qemu-action@v3
60+
61+
- name: Setup Docker Buildx
62+
if: "${{ inputs.docker == 'true' }}"
63+
uses: docker/setup-buildx-action@v3
64+
65+
- name: Login to Docker Hub
66+
if: "${{ inputs.docker-hub == 'true' }}"
67+
uses: docker/login-action@v3
68+
with:
69+
username: ${{ inputs.docker-hub-username }}
70+
password: ${{ inputs.docker-hub-password }}
71+
72+
- name: Login to GitHub Container Registry
73+
if: "${{ inputs.docker-ghcr == 'true' }}"
74+
uses: docker/login-action@v3
75+
with:
76+
registry: ghcr.io
77+
username: ${{ github.actor }}
78+
password: ${{ github.token }}

0 commit comments

Comments
 (0)