Merge pull request #7 from LEQO-Framework/main #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Publish BloqCat Docker Image | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Step 1: Checkout the repository code | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| # Step 2: Set up Docker Buildx | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| # Step 3: Log in to GHCR | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # Step 4: Build and push the Docker image | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: ghcr.io/${{ github.repository_owner }}/bloqcat:latest | |
| # Step 5: Make the image public | |
| - name: Set public visibility for GHCR image | |
| run: | | |
| gh api -X PATCH \ | |
| /user/packages/container/bloqcat/visibility \ | |
| -F visibility=public \ | |
| -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" |