Skip to content

Commit 364fe9f

Browse files
committed
fixes to pipelines - extra tags
1 parent 4c7b473 commit 364fe9f

File tree

3 files changed

+93
-1
lines changed

3 files changed

+93
-1
lines changed

.github/workflows/deploy_to_ghcr.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
org.opencontainers.image.description=Metrics viewer for GitHub Copilot usage
3636
org.opencontainers.image.source=${{ github.repository }}
3737
tags: |
38+
type=raw,value=latest,enable={{is_default_branch}}
3839
type=sha
3940
type=ref,event=branch
4041
type=ref,event=pr
@@ -69,10 +70,11 @@ jobs:
6970
with:
7071
images: ghcr.io/${{ github.repository }}-with-proxy
7172
labels: |
72-
org.opencontainers.image.title=copilot-metrics-viewer
73+
org.opencontainers.image.title=copilot-metrics-viewer-with-proxy
7374
org.opencontainers.image.description=Metrics viewer for GitHub Copilot usage
7475
org.opencontainers.image.source=${{ github.repository }}
7576
tags: |
77+
type=raw,value=latest,enable={{is_default_branch}}
7678
type=sha
7779
type=ref,event=branch
7880
type=ref,event=pr

.github/workflows/deploy_to_ghcr_custom_tag.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,43 @@ jobs:
5555
annotations: ${{ steps.meta.outputs.annotations }}
5656
labels: ${{ steps.meta.outputs.labels }}
5757
push: true
58+
59+
push_proxy_to_ghcr:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Checkout GitHub Action
63+
uses: actions/checkout@v4
64+
65+
- name: Login to GitHub Container Registry
66+
uses: docker/login-action@v3
67+
with:
68+
registry: ghcr.io
69+
username: ${{ github.actor }}
70+
password: ${{ secrets.GITHUB_TOKEN }}
71+
72+
- name: Extract metadata
73+
id: meta
74+
uses: docker/metadata-action@v4
75+
with:
76+
images: ghcr.io/${{ github.repository }}-with-proxy
77+
labels: |
78+
org.opencontainers.image.title=copilot-metrics-viewer-with-proxy
79+
org.opencontainers.image.description=Metrics viewer for GitHub Copilot usage
80+
org.opencontainers.image.source=${{ github.repository }}
81+
tags: |
82+
type=raw,enable=true,priority=1,value=${{ github.event.inputs.tag }}
83+
type=sha
84+
type=ref,event=branch
85+
type=ref,event=pr
86+
type=semver,pattern={{version}}
87+
type=semver,pattern={{major}}.{{minor}}
88+
89+
- name: Build and push
90+
uses: docker/build-push-action@v5
91+
with:
92+
context: .
93+
tags: ${{ steps.meta.outputs.tags }}
94+
annotations: ${{ steps.meta.outputs.annotations }}
95+
labels: ${{ steps.meta.outputs.labels }}
96+
push: true
97+

.github/workflows/deploy_to_ghcr_tag_release.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,53 @@ jobs:
6363
labels: ${{ steps.meta.outputs.labels }}
6464
push: true
6565

66+
push_proxy_to_ghcr:
67+
runs-on: ubuntu-latest
68+
steps:
69+
- name: Checkout GitHub Action
70+
uses: actions/checkout@v4
71+
72+
- name: Login to GitHub Container Registry
73+
uses: docker/login-action@v3
74+
with:
75+
registry: ghcr.io
76+
username: ${{ github.actor }}
77+
password: ${{ secrets.GITHUB_TOKEN }}
78+
79+
- name: Get Latest Release Tag
80+
id: get_latest_release
81+
uses: actions/github-script@v6
82+
with:
83+
script: |
84+
const latestRelease = await github.rest.repos.getLatestRelease({
85+
owner: context.repo.owner,
86+
repo: context.repo.repo,
87+
});
88+
core.setOutput('tag_name', latestRelease.data.tag_name);
89+
90+
- name: Extract metadata
91+
id: meta
92+
uses: docker/metadata-action@v4
93+
with:
94+
images: ghcr.io/${{ github.repository }}-with-proxy
95+
labels: |
96+
org.opencontainers.image.title=copilot-metrics-viewer-with-proxy
97+
org.opencontainers.image.description=Metrics viewer for GitHub Copilot usage
98+
org.opencontainers.image.source=${{ github.repository }}
99+
tags: |
100+
type=raw,enable=true,priority=1,value=${{ steps.get_latest_release.outputs.result }}
101+
type=sha
102+
type=ref,event=branch
103+
type=ref,event=pr
104+
type=semver,pattern={{version}}
105+
type=semver,pattern={{major}}.{{minor}}
106+
107+
- name: Build and push
108+
uses: docker/build-push-action@v5
109+
with:
110+
context: .
111+
tags: ${{ steps.meta.outputs.tags }}
112+
annotations: ${{ steps.meta.outputs.annotations }}
113+
labels: ${{ steps.meta.outputs.labels }}
114+
push: true
115+

0 commit comments

Comments
 (0)