Skip to content

Commit 1545c9d

Browse files
authored
Add GitHub Actions workflow to build and push docker image to GHCR
1 parent 27e631b commit 1545c9d

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/deploy_to_ghcr.yml

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
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
# pull_request:
8+
# types: [opened, synchronize, reopened, closed]
9+
# branches:
10+
# - main
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
permissions:
16+
packages: write
17+
18+
jobs:
19+
push_to_ghcr:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout GitHub Action
23+
uses: actions/checkout@v4
24+
25+
- name: Login to GitHub Container Registry
26+
uses: docker/login-action@v3
27+
with:
28+
registry: ghcr.io
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Build and Push Docker Image
33+
run: |
34+
docker build. --tag ghcr.io/${{ github.repository }}/copilot-metrics-viewer:latest
35+
docker push ghcr.io/${{ github.repository }}/copilot-metrics-viewer:latest

0 commit comments

Comments
 (0)