Spaces:
Sleeping
Sleeping
ci: publish Docker image to GHCR on every main push
Browse files- .github/workflows/ci.yml +18 -2
.github/workflows/ci.yml
CHANGED
|
@@ -32,8 +32,24 @@ jobs:
|
|
| 32 |
needs: test
|
| 33 |
runs-on: ubuntu-latest
|
| 34 |
if: github.ref == 'refs/heads/main'
|
|
|
|
|
|
|
|
|
|
| 35 |
steps:
|
| 36 |
- uses: actions/checkout@v4
|
| 37 |
|
| 38 |
-
- name:
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
needs: test
|
| 33 |
runs-on: ubuntu-latest
|
| 34 |
if: github.ref == 'refs/heads/main'
|
| 35 |
+
permissions:
|
| 36 |
+
contents: read
|
| 37 |
+
packages: write
|
| 38 |
steps:
|
| 39 |
- uses: actions/checkout@v4
|
| 40 |
|
| 41 |
+
- name: Log in to GitHub Container Registry
|
| 42 |
+
uses: docker/login-action@v3
|
| 43 |
+
with:
|
| 44 |
+
registry: ghcr.io
|
| 45 |
+
username: ${{ github.actor }}
|
| 46 |
+
password: ${{ secrets.GITHUB_TOKEN }}
|
| 47 |
+
|
| 48 |
+
- name: Build and push Docker image
|
| 49 |
+
uses: docker/build-push-action@v5
|
| 50 |
+
with:
|
| 51 |
+
context: .
|
| 52 |
+
push: true
|
| 53 |
+
tags: |
|
| 54 |
+
ghcr.io/${{ github.repository }}:latest
|
| 55 |
+
ghcr.io/${{ github.repository }}:${{ github.sha }}
|