|
1 | | -name: Build and Push Docker Image |
| 1 | +name: Build and Publish BloqCat Docker Image |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
9 | 9 | build-and-push: |
10 | 10 | runs-on: ubuntu-latest |
11 | 11 | steps: |
12 | | - - uses: actions/checkout@v2 |
| 12 | + # Step 1: Checkout the repository code |
| 13 | + - name: Checkout code |
| 14 | + uses: actions/checkout@v3 |
13 | 15 |
|
14 | | - - name: Set up Docker Buildx |
15 | | - uses: docker/setup-buildx-action@v1 |
| 16 | + # Step 2: Set up Docker Buildx |
| 17 | + - name: Set up Docker Buildx |
| 18 | + uses: docker/setup-buildx-action@v2 |
16 | 19 |
|
17 | | - - name: Log in to GitHub Container Registry |
18 | | - uses: docker/login-action@v1 |
19 | | - with: |
20 | | - registry: ghcr.io |
21 | | - username: ${{ github.actor }} |
22 | | - password: ${{ secrets.GHCR_PAT }} |
| 20 | + # Step 3: Log in to GHCR |
| 21 | + - name: Log in to GitHub Container Registry |
| 22 | + uses: docker/login-action@v2 |
| 23 | + with: |
| 24 | + registry: ghcr.io |
| 25 | + username: ${{ github.actor }} |
| 26 | + password: ${{ secrets.GITHUB_TOKEN }} |
23 | 27 |
|
24 | | - - name: Build and push |
25 | | - uses: docker/build-push-action@v2 |
26 | | - with: |
27 | | - context: . |
28 | | - file: ./Dockerfile |
29 | | - push: true |
30 | | - tags: ghcr.io/aldekal/bloqcat:latest |
| 28 | + # Step 4: Build and push the Docker image |
| 29 | + - name: Build and push Docker image |
| 30 | + uses: docker/build-push-action@v2 |
| 31 | + with: |
| 32 | + context: . |
| 33 | + file: ./Dockerfile |
| 34 | + push: true |
| 35 | + tags: ghcr.io/${{ github.repository_owner }}/bloqcat:latest |
| 36 | + |
| 37 | + # Step 5: Make the image public |
| 38 | + - name: Set public visibility for GHCR image |
| 39 | + run: | |
| 40 | + gh api -X PATCH \ |
| 41 | + /user/packages/container/bloqcat/visibility \ |
| 42 | + -F visibility=public \ |
| 43 | + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" |
0 commit comments