Merge branch 'dev' of https://github.com/rohanbatrain/second_brain_da… #7
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 Docker Dev Image to GHCR | |
| # Trigger the action when pushing to the main branch | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout the code from the repository | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| # Set up Docker Buildx (needed for building Docker images in GitHub Actions) | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| # Login to Docker Hub before building and pushing (good practice) | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: rohanbatra | |
| password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
| # Build and push Docker image to Docker Hub | |
| - name: Build and Push Docker image (Docker Hub) | |
| run: | | |
| docker build -t rohanbatra/second_brain_database:dev . | |
| docker push rohanbatra/second_brain_database:dev | |
| - name: Publish to Github Registry | |
| uses: elgohr/Publish-Docker-Github-Action@v5 | |
| with: | |
| name: rohanbatrain/second_brain_database/dev | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| registry: ghcr.io |