SkyScan Version 2.1 #2
Workflow file for this run
This file contains 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: Release Tagging | |
on: | |
release: | |
types: [ "published" ] | |
jobs: | |
tag-remote: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get tag | |
id: get_tag | |
run: | | |
echo "::set-output name=IMAGE_TAG::$(echo $GITHUB_REF | cut -d / -f 3)" | |
- name: Set up qemu | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: all | |
- name: Set up Docker buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
version: latest | |
- name: Login to Docker Hub | |
run: echo "${{ secrets.DOCKER_TOKEN }}" | docker login --username "${{ vars.DOCKER_USERNAME }}" --password-stdin | |
- name: Build image | |
env: | |
GITHUB_REPOSITORY: ${{ github.repository }} | |
REPO_TOKEN: ${{ secrets.REPO_TOKEN }} | |
DOCKER_FOLDERS: "axis-ptz,egi,mqtt,notebook-server,piaware,tracker,pan-tilt-pi" | |
DOCKER_NAMESPACE: ${{ vars.DOCKER_NAMESPACE }} | |
RELEASE_NAME: ${{ github.event.release.name }} | |
TAG_NAME: ${{ github.event.release.tag_name }} | |
PROJECT_NAME: "skyscan" | |
run: | | |
IFS="," | |
read -ra ARR <<< "$DOCKER_FOLDERS" | |
for folder in "${ARR[@]}" | |
do | |
IFS="/" | |
read -ra NAMEFOLDER <<< $folder | |
SUBNAME=${NAMEFOLDER[0]} | |
PUBLISHNAME="" | |
if [ $NAMEFOLDER != $SUBNAME ]; then | |
PUBLISHNAME=$PROJECT_NAME-$folder-$SUBNAME | |
else | |
PUBLISHNAME=$PROJECT_NAME-$folder | |
fi | |
echo "TAGGING..." | |
echo $PUBLISHNAME | |
echo $RELEASE_NAME | |
echo $TAG_NAME | |
docker buildx build $folder \ | |
--push \ | |
--tag $DOCKER_NAMESPACE/$PUBLISHNAME:$TAG_NAME \ | |
--platform linux/arm64,linux/amd64 | |
done |