github action to build image setup #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 Push Authentic Image | |
| on: | |
| push: | |
| branches: | |
| - RhooneN | |
| workflow_dispatch: | |
| jobs: | |
| docker: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build Docker image | |
| run: | | |
| docker build -t ghcr.io/RhooneN/ecommerce-api-auth:latest . | |
| - name: Push Docker image | |
| run: | | |
| docker push ghcr.io/RhooneN/ecommerce-api-auth:latest |