correctPulledImage #6
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: Tag Image | ||
| on: | ||
| workflow_call: | ||
| workflow_dispatch: | ||
| jobs: | ||
| tag: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Output short SHA | ||
| run: echo "GITHUB_SHORT_SHA=${GITHUB_SHA::7}" >> "$GITHUB_ENV" | ||
| - name: Output Docker repo to be pulled from | ||
| run: ` >> "$GITHUB_ENV" | ||
| - name: Output Docker image to be pulled | ||
| run: echo "DOCKER_IMAGE=${DOCKER_REPO}:sha-${GITHUB_SHORT_SHA}" >> "$GITHUB_ENV" | ||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
| - name: Login to GitHub Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Determine long-lived Docker image tags | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ github.env.DOCKER_IMAGE }} | ||
| tags: | | ||
| type=sha | ||
| type=ref,event=branch | ||
| type=ref,event=tag | ||
| type=semver,pattern={{major}} | ||
| type=semver,pattern={{major}}.{{minor}} | ||
| type=semver,pattern={{version}} | ||
| type=raw,value=latest,enable={{is_default_branch}} | ||
| - name: Pull the image to be retagged | ||
| run: docker pull "${DOCKER_IMAGE}" | ||