Skip to content

Commit

Permalink
Merge pull request #2 from cyberverse-dev/add-dockerhub-support
Browse files Browse the repository at this point in the history
Add Docker Hub support to GitHub Actions workflows
  • Loading branch information
vkartk authored May 27, 2024
2 parents 1e09cf8 + 24f6698 commit 3a72e34
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
Expand All @@ -39,10 +45,13 @@ jobs:
tags: |
ghcr.io/${{ github.repository_owner }}/caddy-cloudflare-docker:${{ github.event.client_payload.latest_version }}
ghcr.io/${{ github.repository_owner }}/caddy-cloudflare-docker:latest
${{ secrets.DOCKERHUB_USERNAME }}/caddy-cloudflare-docker:${{ github.event.client_payload.latest_version }}
${{ secrets.DOCKERHUB_USERNAME }}/caddy-cloudflare-docker:latest
- name: Clean up Docker images
run: |
docker rmi ghcr.io/${{ github.repository_owner }}/caddy-cloudflare-docker:${{ github.event.client_payload.latest_version }} || true
docker rmi ${{ secrets.DOCKERHUB_USERNAME }}/caddy-cloudflare-docker:${{ github.event.client_payload.latest_version }} || true
docker builder prune --force
- name: Create GitHub Release
Expand Down
1 change: 0 additions & 1 deletion version.json

This file was deleted.

0 comments on commit 3a72e34

Please sign in to comment.