Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
generate aliases for snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
angelnu committed Jan 4, 2021
1 parent f0bb2ba commit bb509e0
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/ci.yml
Expand Up @@ -167,7 +167,6 @@ jobs:
max_releases: 1

- name: upload build as workflow artifact
if: github.event_name != 'schedule'
uses: actions/upload-artifact@v2
with:
path: release/RaspberryMatic-${{ env.VERSION }}-${{ matrix.platform }}.zip*
Expand Down Expand Up @@ -227,11 +226,24 @@ jobs:
unzip -f $f
done
- name: Extract branch name
- name: Build tags
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
run: |
BASE_TAG="ghcr.io/${{ github.repository_owner }}/raspberrymatic"
TAGS="${BASE_TAG}:${{ env.VERSION }}-${{ env.GITHUB_SHA7 }}"
if [[ ${GITHUB_EVENT_NAME} = 'schedule' || ${GITHUB_EVENT_NAME} = 'push' ]]; then
BRANCH="${GITHUB_REF##*/}"
if [ $BRANCH = master ]; then
TAGS="${TAGS} ${BASE_TAG}:snapshot"
else
TAGS="${TAGS}"$'\n'"${BASE_TAG}:snapshot-${BRANCH}"
fi
fi
echo "##[set-output name=image_tags;]${TAGS}"
id: extract_branch

- uses: docker/setup-buildx-action@v1

This comment has been minimized.

Copy link
@jens-maus

jens-maus Jan 4, 2021

I just spotted you are working hard in getting this damn ghcr.io CI going :) Don't want to interfere here, but have you found the following resource: docker/build-push-action#100 (comment)

To me it looks like you are still missing the login part in the CI, isn't it? ;)


- name: build and push container image
uses: docker/build-push-action@v2
id: docker_build
Expand All @@ -242,9 +254,7 @@ jobs:
push: true
build-args: |
tar_prefix=RaspberryMatic-${{ env.VERSION }}-${{ env.GITHUB_SHA7 }}-oci_
tags: |
ghcr.io/${{ github.repository_owner }}/raspberrymatic:${{ env.VERSION }}-${{ env.GITHUB_SHA7 }}
ghcr.io/${{ github.repository_owner }}/raspberrymatic:${{ steps.extract_branch.outputs.branch }}
tags: ${{ steps.extract_branch.outputs.image_tags }}

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

0 comments on commit bb509e0

Please sign in to comment.