Skip to content

Commit

Permalink
Updated variable expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniomika committed Nov 9, 2019
1 parent a7c2829 commit 9d4d544
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,23 @@ jobs:
env:
DOCKER_USERNAME: ${{ secrets.GITHUB_DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.GITHUB_DOCKER_PASSWORD }}
run: echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
run: echo ${DOCKER_PASSWORD} | docker login -u ${DOCKER_USERNAME} --password-stdin
- name: Build and push the Docker images
run: |
DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
OTHER_TAGS=""
REF="master"
if [[ $GITHUB_REF =~ ^refs\/tags\/v.*$ ]]
if [[ ${GITHUB_REF} =~ ^refs\/tags\/v.*$ ]]
then
REF="${GITHUB_REF//refs\/tags\/}"
OTHER_TAGS="$OTHER_TAGS -t $GITHUB_REPOSITORY:$REF -t $GITHUB_REPOSITORY:latest"
OTHER_TAGS="${OTHER_TAGS} -t ${GITHUB_REPOSITORY}:${REF} -t ${GITHUB_REPOSITORY}:latest"
fi
docker buildx build \
--push \
--platform linux/arm/v7,linux/arm64,linux/amd64 \
--build-arg VERSION=$REF \
--build-arg COMMIT=$GITHUB_SHA \
--build-arg DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ) \
-t $GITHUB_REPOSITORY:$GITHUB_SHA \
$OTHER_TAGS .
--build-arg VERSION=${REF} \
--build-arg COMMIT=${GITHUB_SHA} \
--build-arg DATE=${DATE} \
-t ${GITHUB_REPOSITORY}:${GITHUB_SHA} \
${OTHER_TAGS} .

0 comments on commit 9d4d544

Please sign in to comment.