Deploy to GHCR
This commit is contained in:
11
.github/workflows/docker-image.yml
vendored
11
.github/workflows/docker-image.yml
vendored
@@ -12,5 +12,14 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set Environment
|
||||
run: |
|
||||
echo "SLUG=ghcr.io/cwpearson/ytdlp-site" >> $GITHUB_ENV
|
||||
echo "DATE=$(date +"%Y%m%d_%H%M")" >> $GITHUB_ENV
|
||||
- name: Build the Docker image
|
||||
run: docker build . --file Dockerfile --tag server:$(date +%Y%m%d_%H%M)
|
||||
run: docker build . --file Dockerfile --tag "$SLUG:$DATE" --tag "$SLUG:latest"
|
||||
- name: Publish to GHCR
|
||||
run: |
|
||||
echo '${{secrets.GHCR_TOKEN}}' | docker login ghcr.io -u cwpearson --password-stdin
|
||||
docker push "$SLUG:latest"
|
||||
docker push "$SLUG:$DATE"
|
10
README.md
10
README.md
@@ -32,4 +32,12 @@ docker run --rm -it \
|
||||
--env YTDLP_SITE_ADMIN_INITIAL_PASSWORD=abc123 \
|
||||
-v $(realpath downloads):/downloads \
|
||||
server
|
||||
```
|
||||
```
|
||||
|
||||
## GHCR Deploy
|
||||
|
||||
Build and push this container to ghcr
|
||||
|
||||
* Create a "personal access token (classic)" with write:packages
|
||||
* account > settings > developer settings > personal access tokens > tokens (classic) > generate new token (classic)
|
||||
* Put that personal access token as the repository actions secret `GHCR_TOKEN`.
|
||||
|
Reference in New Issue
Block a user