Merge pull request #1 from itachi21113/deploying #12
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 for our workflow, which will appear in the GitHub Actions tab | |
| name: Build and Push Docker Images | |
| on: | |
| push: | |
| branches: | |
| - master # Corrected to use 'master' as your branch name | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build and push backend image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: ./ecom-backend | |
| push: true | |
| tags: itachi21113/ecom-backend:latest | |
| - name: Build and push frontend image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: ./myShop-frontend | |
| push: true | |
| tags: itachi21113/ecom-frontend:latest | |