Update main.yml #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: Docker Image CI | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: $${{ github.repository }} | |
| jobs: | |
| build-container: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@v6.0.1 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| # - name: docker login | |
| # uses: docker/login-action@v3.6.0 | |
| # with: | |
| # username: ${{ secrets.DOCKERHUB_USER }} | |
| # password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
| - name: docker login to GHCR | |
| uses: docker/login-action@v3.6.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build & Push Image | |
| uses: docker/build-push-action@v6.18.0 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: latest | |