Skip to content

Commit 7d3740f

Browse files
authored
Merge pull request #28 from AdrianDsg/adriandsg/add-docker-deploy-workflow
Add GitHub Actions workflow to build and push docker image to GHCR
2 parents 84b4268 + 7bc0985 commit 7d3740f

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/deploy_to_ghcr.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build and push Docker image
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+
docker build. --tag ghcr.io/${{ github.repository }}/copilot-metrics-viewer:latest
31+
docker push ghcr.io/${{ github.repository }}/copilot-metrics-viewer:latest

0 commit comments

Comments
 (0)