Skip to content

Commit bfd6c08

Browse files
authored
Upload Docker images to GHCR (#218)
1 parent 9f021e8 commit bfd6c08

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,20 @@ jobs:
7171
username: ${{ secrets.DOCKER_USERNAME }}
7272
password: ${{ secrets.DOCKER_PASSWORD }}
7373
if: github.event_name != 'pull_request'
74+
- name: Login to GitHub Container Registry
75+
uses: docker/login-action@v1
76+
with:
77+
registry: ghcr.io
78+
username: ${{ github.repository_owner }}
79+
password: ${{ secrets.GITHUB_TOKEN }}
80+
if: github.event_name != 'pull_request'
7481
- name: Docker meta
7582
id: meta
7683
uses: docker/metadata-action@v3
7784
with:
78-
images: nginx/nginx-prometheus-exporter
85+
images: |
86+
nginx/nginx-prometheus-exporter
87+
ghcr.io/nginxinc/nginx-prometheus-exporter
7988
tags: |
8089
type=edge
8190
type=ref,event=pr
@@ -95,7 +104,7 @@ jobs:
95104
uses: goreleaser/goreleaser-action@v2
96105
with:
97106
version: latest
98-
args: --rm-dist ${{ github.event_name == 'pull_request' && '--single-target' || '' }} ${{ !startsWith(github.ref, 'refs/tags/') && 'build --snapshot' || 'release' }}
107+
args: ${{ !startsWith(github.ref, 'refs/tags/') && 'build --snapshot' || 'release' }} ${{ github.event_name == 'pull_request' && '--single-target' || '' }} --rm-dist
99108
env:
100109
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101110
GOPATH: ${{ env.GOPATH }}

0 commit comments

Comments
 (0)