mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Use GitHub Container Registry for Docker images
GHCR allows images to be pulled anonymously
This commit is contained in:
parent
83678756c7
commit
7dd5d97279
3 changed files with 38 additions and 14 deletions
29
.github/workflows/main.yml
vendored
29
.github/workflows/main.yml
vendored
|
|
@ -1,6 +1,7 @@
|
|||
on:
|
||||
release:
|
||||
types: [published]
|
||||
push:
|
||||
branches:
|
||||
- feat/push-to-github-container-registry
|
||||
|
||||
jobs:
|
||||
|
||||
|
|
@ -13,17 +14,29 @@ jobs:
|
|||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build PostgreSQL container image
|
||||
run: docker build --build-arg DATABASE_TYPE=postgresql --tag docker.pkg.github.com/mikecao/umami/umami:postgresql-$(echo $GITHUB_SHA | head -c7) .
|
||||
run: |
|
||||
docker build --build-arg DATABASE_TYPE=postgresql \
|
||||
--tag ghcr.io/$GITHUB_ACTOR/umami:postgresql-$(echo $GITHUB_SHA | head -c7) \
|
||||
--tag ghcr.io/$GITHUB_ACTOR/umami:postgresql-latest \
|
||||
.
|
||||
|
||||
- name: Build MySQL container image
|
||||
run: docker build --build-arg DATABASE_TYPE=mysql --tag docker.pkg.github.com/mikecao/umami/umami:mysql-$(echo $GITHUB_SHA | head -c7) .
|
||||
run: |
|
||||
docker build --build-arg DATABASE_TYPE=mysql \
|
||||
--tag ghcr.io/$GITHUB_ACTOR/umami:mysql-$(echo $GITHUB_SHA | head -c7) \
|
||||
--tag ghcr.io/$GITHUB_ACTOR/umami:mysql-latest \
|
||||
.
|
||||
|
||||
- name: Docker login
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: docker login -u mikecao -p $GITHUB_TOKEN docker.pkg.github.com
|
||||
CR_PAT: ${{ secrets.CR_PAT }}
|
||||
run: docker login -u $GITHUB_ACTOR -p $CR_PAT ghcr.io
|
||||
|
||||
- name: Push image to GitHub
|
||||
run: |
|
||||
docker push docker.pkg.github.com/mikecao/umami/umami:postgresql-$(echo $GITHUB_SHA | head -c7)
|
||||
docker push docker.pkg.github.com/mikecao/umami/umami:mysql-$(echo $GITHUB_SHA | head -c7)
|
||||
# Push each image individually, avoiding pushing to umami:latest
|
||||
# as MySQL or PostgreSQL are required
|
||||
docker push ghcr.io/$GITHUB_ACTOR/umami:postgresql-$(echo $GITHUB_SHA | head -c7)
|
||||
docker push ghcr.io/$GITHUB_ACTOR/umami:postgresql-latest
|
||||
docker push ghcr.io/$GITHUB_ACTOR/umami:mysql-$(echo $GITHUB_SHA | head -c7)
|
||||
docker push ghcr.io/$GITHUB_ACTOR/umami:mysql-latest
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue