|
9 | 9 | description: Whether to setup Node.js or not. |
10 | 10 | default: "true" |
11 | 11 | 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. |
13 | 13 | 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. |
14 | 27 |
|
15 | 28 | runs: |
16 | 29 | using: composite |
|
40 | 53 | key: cache-node-modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} |
41 | 54 | restore-keys: | |
42 | 55 | 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