forked from comit-network/xmr-btc-swap
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Publish docker images to ghcr.io instead of docker hub
- Loading branch information
1 parent
8adf86d
commit 91482f1
Showing
1 changed file
with
10 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,6 +130,9 @@ jobs: | |
name: Build and Push Docker Image | ||
runs-on: ubuntu-latest | ||
needs: build_binaries | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
|
@@ -139,19 +142,20 @@ jobs: | |
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set Docker tags | ||
id: docker_tags | ||
run: | | ||
if [[ ${{ github.event.release.tag_name }} == "preview" ]]; then | ||
echo "::set-output name=preview::true" | ||
echo "preview=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "::set-output name=preview::false" | ||
echo "preview=false" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Build and push Docker image | ||
|
@@ -172,4 +176,4 @@ jobs: | |
file: ./Dockerfile | ||
push: true | ||
tags: ${{ env.DOCKER_IMAGE_NAME }}:${{ github.event.release.tag_name }} | ||
if: steps.docker_tags.outputs.preview == 'true' | ||
if: steps.docker_tags.outputs.preview == 'true' |