Skip to content

Commit 5474e8d

Browse files
author
Carlos
committed
fix: use GITHUB_TOKEN + dynamic tags for ghcr.io
1 parent 6724fc0 commit 5474e8d

1 file changed

Lines changed: 32 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
name: Publish to PyPI
1+
name: Publish
22

33
on:
44
release:
55
types: [published]
66
workflow_dispatch:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
pypi:
1013
runs-on: ubuntu-latest
@@ -19,3 +22,31 @@ jobs:
1922
env:
2023
TWINE_USERNAME: __token__
2124
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
25+
26+
docker:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Log in to ghcr.io
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
- name: Build and push
37+
uses: docker/build-push-action@v5
38+
with:
39+
context: .
40+
push: true
41+
tags: ghcr.io/${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:${{ github.ref_name }}
42+
43+
deploy-hf:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
- name: Push to HuggingFace Spaces
48+
env:
49+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
50+
run: |
51+
git remote add hf https://user:${HF_TOKEN}@huggingface.co/spaces/Syntho/palisade-scanner
52+
git push hf main

0 commit comments

Comments
 (0)