Skip to content

Commit 3fdaab8

Browse files
authored
Merge pull request #351 from nanotaboada/feature/ghcr
feat(ci): update workflow to build and push Docker image to GHCR
2 parents ad1b8a3 + 582396b commit 3fdaab8

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/python-app.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,35 @@ jobs:
100100
with:
101101
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
102102
coverage-reports: coverage.xml
103+
104+
container:
105+
needs: coverage
106+
runs-on: ubuntu-latest
107+
108+
permissions:
109+
contents: read
110+
packages: write
111+
112+
steps:
113+
- name: Checkout repository
114+
uses: actions/checkout@v4
115+
116+
- name: Log in to GitHub Container Registry
117+
uses: docker/login-action@v3
118+
with:
119+
registry: ghcr.io
120+
username: ${{ github.actor }}
121+
password: ${{ secrets.GITHUB_TOKEN }}
122+
123+
- name: Set up Docker Buildx
124+
uses: docker/setup-buildx-action@v3
125+
126+
- name: Build and push Docker image to GitHub Container Registry
127+
uses: docker/build-push-action@v5
128+
with:
129+
context: .
130+
push: true
131+
tags: |
132+
ghcr.io/${{ github.repository }}:latest
133+
ghcr.io/${{ github.repository }}:main
134+
ghcr.io/${{ github.repository }}:sha-${{ github.sha }}

0 commit comments

Comments
 (0)