docker-dev #37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: docker-dev | |
| on: | |
| workflow_dispatch: # manually run | |
| inputs: | |
| custom_tag: | |
| description: 'Custom tag to use for the image (defaults to commit hash if empty)' | |
| required: false | |
| images: | |
| description: 'Space-separated list of images to publish (leave empty for all)' | |
| required: false | |
| env: | |
| CI: true | |
| jobs: | |
| publish: | |
| name: docker-dev-publish | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Docker login | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_LOGIN }} | |
| password: ${{ secrets.DOCKER_TOKEN }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: all | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| use: true | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Get commit short SHA | |
| id: commit_sha | |
| run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| - name: Build and Publish | |
| run: | | |
| CUSTOM_TAG="${{ inputs.custom_tag }}" | |
| if [ -z "$CUSTOM_TAG" ]; then | |
| CUSTOM_TAG="${{ steps.commit_sha.outputs.sha }}" | |
| fi | |
| IFS=' ' read -r -a image_array <<< "${{ inputs.images }}" | |
| ./ops/docker-publish-dev.sh "$CUSTOM_TAG" "${image_array[@]}" |