Deploy to GHCR

This commit is contained in:
Carl Pearson
2024-09-06 11:12:42 -06:00
parent 20d83600ab
commit 7c96092b3c
2 changed files with 19 additions and 2 deletions

View File

@@ -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"

View File

@@ -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`.