Skip to content

Commit 0d5f4e0

Browse files
committed
deploy to ghcr
1 parent 3ce3c4b commit 0d5f4e0

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build and push Docker image for Proxy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
permissions:
12+
packages: write
13+
14+
jobs:
15+
push_to_ghcr:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout GitHub Action
19+
uses: actions/checkout@v4
20+
21+
- name: Login to GitHub Container Registry
22+
uses: docker/login-action@v3
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Build and Push Docker Image
29+
run: |
30+
GITHUB_REPO="${GITHUB_REPO,,}-with-proxy" # convert repo name to lowercase as required by docker
31+
echo "building docker image in repository '$GITHUB_REPO' ..."
32+
docker build --label "org.opencontainers.image.title=copilot-metrics-viewer-with-proxy" --label "org.opencontainers.image.description=Metrics viewer with proxy for GitHub Copilot usage" --label "org.opencontainers.image.source=$GITHUB_REPO" -t ghcr.io/$GITHUB_REPO:latest .
33+
docker push ghcr.io/$GITHUB_REPO:latest
34+
env:
35+
GITHUB_REPO: ${{ github.repository }}

0 commit comments

Comments
 (0)