Skip to content

Commit

Permalink
Publish to ghcr (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbs2001 committed Aug 2, 2022
1 parent 53bb403 commit 6b30687
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/release_publish_docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
id: prep
run: |
DOCKER_IMAGE=crowdsecurity/cloudflare-bouncer
GHCR_IMAGE=ghcr.io/${{ github.repository_owner }}/cloudflare-bouncer
VERSION=edge
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
Expand All @@ -25,9 +26,9 @@ jobs:
elif [[ $GITHUB_REF == refs/pull/* ]]; then
VERSION=pr-${{ github.event.number }}
fi
TAGS="${DOCKER_IMAGE}:${VERSION}"
TAGS="${DOCKER_IMAGE}:${VERSION},${GHCR_IMAGE}:${VERSION}"
if [[ ${{ github.event.action }} == released ]]; then
TAGS=$TAGS,${DOCKER_IMAGE}:latest
TAGS=$TAGS,${DOCKER_IMAGE}:latest,${GHCR_IMAGE}:${VERSION}
fi
echo ::set-output name=version::${VERSION}
echo ::set-output name=tags::${TAGS}
Expand All @@ -44,6 +45,13 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v1.12.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
Expand Down

0 comments on commit 6b30687

Please sign in to comment.