Release Tagging #3
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: | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
version: latest | |
- name: Docker Login | |
run: echo "${{ secrets.DOCKER_TOKEN }}" | docker login --username "${{ secrets.DOCKER_USERNAME }}" --password-stdin | |
- name: Build Images | |
env: | |
# Every folder in the repo that has a Dockerfile within it, comma separated | |
DOCKERFOLDERS: "daisy" | |
DOCKERNAMESPACE: ${{ secrets.DOCKER_NAMESPACE }} | |
PROJECT_NAME: "edgetech" | |
RELEASENAME: ${{ github.event.release.name }} | |
run: | | |
IFS="," | |
read -ra ARR <<< "$DOCKERFOLDERS" | |
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 $RELEASENAME | |
docker buildx imagetools create $DOCKERNAMESPACE/$PUBLISHNAME:latest --tag $DOCKERNAMESPACE/$PUBLISHNAME:$RELEASENAME | |
done | |