Docker retag yaml added #1
Workflow file for this run
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 Retag from Edge | |
on: | |
push: | |
tags: | |
- v[0-9]+.[0-9]+.[0-9]+ | |
pull_request: | |
branches: [main] | |
jobs: | |
docker-retag: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Extract Tag or SHA | |
id: meta | |
run: | | |
if [[ "${{ github.event_name }}" == "push" ]]; then | |
TAG_NAME="${GITHUB_REF#refs/tags/}" | |
else | |
TAG_NAME="test-pr-${GITHUB_SHA::7}" | |
fi | |
echo "tag=$TAG_NAME" >> "$GITHUB_OUTPUT" | |
- name: Retag from edge and push | |
run: | | |
docker buildx imagetools create \ | |
--tag parseable/parseable:${{ steps.meta.outputs.tag }} \ | |
parseable/parseable:edge | |
- name: Inspect new tag (optional) | |
run: | | |
docker buildx imagetools inspect parseable/parseable:${{ steps.meta.outputs.tag }} |