mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Merge pull request #828 from paperless-ngx/feature-docker-hub-push
Enable Docker Hub push
This commit is contained in:
commit
8b798013c1
30
.github/workflows/ci.yml
vendored
30
.github/workflows/ci.yml
vendored
@ -63,13 +63,6 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
-
|
|
||||||
name: Login to Github Container Registry
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
-
|
-
|
||||||
name: Set up Python
|
name: Set up Python
|
||||||
uses: actions/setup-python@v3
|
uses: actions/setup-python@v3
|
||||||
@ -247,12 +240,25 @@ jobs:
|
|||||||
- build-pikepdf-wheel
|
- build-pikepdf-wheel
|
||||||
- build-frontend
|
- build-frontend
|
||||||
steps:
|
steps:
|
||||||
|
-
|
||||||
|
name: Check pushing to Docker Hub
|
||||||
|
id: docker-hub
|
||||||
|
# Only push to Dockerhub from the main repo
|
||||||
|
# Otherwise forks would require a Docker Hub account and secrets setup
|
||||||
|
run: |
|
||||||
|
if [[ ${{ github.repository }} == "paperless-ngx/paperless-ngx" ]] ; then
|
||||||
|
echo ::set-output name=enable::"true"
|
||||||
|
else
|
||||||
|
echo ::set-output name=enable::"false"
|
||||||
|
fi
|
||||||
-
|
-
|
||||||
name: Gather Docker metadata
|
name: Gather Docker metadata
|
||||||
id: docker-meta
|
id: docker-meta
|
||||||
uses: docker/metadata-action@v3
|
uses: docker/metadata-action@v3
|
||||||
with:
|
with:
|
||||||
images: ghcr.io/${{ github.repository }}
|
images: |
|
||||||
|
ghcr.io/${{ github.repository }}
|
||||||
|
name=paperlessngx/paperless-ngx,enable=${{ steps.docker-hub.outputs.enable }}
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
@ -272,6 +278,14 @@ jobs:
|
|||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
-
|
||||||
|
name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
# Don't attempt to login is not pushing to Docker Hub
|
||||||
|
if: steps.docker-hub.outputs.enable == 'true'
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user