Skip to content

CreateServiceTag

CreateServiceTag #1799

name: Retag image
on:
repository_dispatch:
types:
- CreateServiceTag
jobs:
update_stack_repo:
name: Create Service Tag ${{ github.event.client_payload.baseImage.repository }}:${{ github.event.client_payload.baseImage.tag }}
runs-on: ubuntu-latest
env:
BASE_SERVICE_REPO: ${{ github.event.client_payload.baseImage.repository }}
BASE_SERVICE_TAG: ${{ github.event.client_payload.baseImage.tag }}
NEW_SERVICE_REPO: ${{ github.event.client_payload.newImage.repository }}
NEW_SERVICE_TAG: ${{ github.event.client_payload.newImage.tag }}
steps:
- name: Install regctl
uses: iarekylew00t/regctl-installer@v1
with:
regctl-release: v0.5.3
- name: Login to Docker Hub
run: docker login -u ${{ secrets.DOCKER_HUB_USER }} -p '${{ secrets.DOCKER_HUB_PASS }}'
- name: Publish Image to Docker Hub
run: |
regctl image copy ${{ env.BASE_SERVICE_REPO }}:${{ env.BASE_SERVICE_TAG }} ${{ env.NEW_SERVICE_REPO }}:${{ env.NEW_SERVICE_TAG }}
- name: Scan Using Aquasec
uses: armory-io/aquasec-scan-action@v0.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
username: ${{ secrets.AQUA_USER }}
password: ${{ secrets.AQUA_PASSWORD }}
url: https://aquasec.armory.io
registry: Docker Hub
image: ${{ env.NEW_SERVICE_REPO }}:${{ env.NEW_SERVICE_TAG }}
- name: Login to Artifactory
run: docker login -u ${{ secrets.ARTIFACTORY_USER }} -p ${{ secrets.ARTIFACTORY_PASSWORD }} armory-docker-local.jfrog.io
- name: Publish Image to Artifactory
run: |
regctl image copy ${{ env.BASE_SERVICE_REPO }}:${{ env.BASE_SERVICE_TAG }} armory-docker-local.jfrog.io/${{ env.NEW_SERVICE_REPO }}:${{ env.NEW_SERVICE_TAG }}