name: "Setup Docker" inputs: username: description: "Username" required: true password: description: "Password" required: true ghcr_username: description: "GHCR username. Usually set from the github.actor variable" required: true ghcr_password: description: "GHCR password. Usually set from the secrets.GITHUB_TOKEN variable" required: true outputs: sha_short: description: "The short SHA used for image builds" value: ${{ steps.vars.outputs.sha_short }} runs: using: "composite" steps: - name: Get Short SHA id: vars run: | echo ::set-output name=sha_short::${GITHUB_SHA::7} shell: bash - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 with: version: latest - name: Login to DockerHub if: ${{ github.event_name == 'release' || github.event_name == 'push' && github.ref == 'refs/heads/master' }} uses: docker/login-action@v2 with: username: ${{ inputs.username }} password: ${{ inputs.password }} - name: Login to GitHub Container Registry if: ${{ github.event_name == 'release' || github.event_name == 'push' && github.ref == 'refs/heads/master' }} uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ inputs.ghcr_username }} password: ${{ inputs.ghcr_password }}