From c430274d7e8b8e9c758db81e03e76277c2c26149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cenk=20K=C3=BCc=C3=BCk?= Date: Thu, 15 Feb 2024 12:42:25 +0000 Subject: [PATCH] push docker images to ghcr.io (#3787) --- .github/workflows/build-private-images.yml | 15 ++++++++++++++- .github/workflows/build-public-images.yml | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-private-images.yml b/.github/workflows/build-private-images.yml index c84177cb59..2c3cb10310 100644 --- a/.github/workflows/build-private-images.yml +++ b/.github/workflows/build-private-images.yml @@ -16,12 +16,18 @@ jobs: if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'deploy-to-staging') }} runs-on: buildjet-16vcpu-ubuntu-2204 + permissions: + contents: read + packages: write + steps: - name: Docker meta id: meta uses: docker/metadata-action@v5.0.0 with: - images: plausible/analytics-private + images: | + plausible/analytics-private + ghcr.io/plausible/analytics/ee tags: | type=ref,event=pr type=ref,event=branch @@ -36,6 +42,13 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push id: docker_build uses: docker/build-push-action@v5 diff --git a/.github/workflows/build-public-images.yml b/.github/workflows/build-public-images.yml index edb215e5be..f299729064 100644 --- a/.github/workflows/build-public-images.yml +++ b/.github/workflows/build-public-images.yml @@ -12,12 +12,18 @@ jobs: build: runs-on: buildjet-16vcpu-ubuntu-2204 + permissions: + contents: read + packages: write + steps: - name: Docker meta id: meta uses: docker/metadata-action@v5 with: - images: plausible/analytics + images: | + plausible/analytics + ghcr.io/plausible/analytics tags: | type=semver,pattern={{version}},prefix=v type=semver,pattern={{major}}.{{minor}},prefix=v @@ -35,6 +41,13 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push id: docker_build uses: docker/build-push-action@v5