Build and deploy to Docker Hub #1
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 deploy to Docker Hub | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Docker compose build | |
| run: docker-compose build | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Push to Docker Hub | |
| run: | | |
| docker tag ci-cd-example_frontend:latest ${{ secrets.DOCKER_USERNAME }}/cicd-demo-frontend:latest | |
| docker tag ci-cd-example_backend:latest ${{ secrets.DOCKER_USERNAME }}/cicd-demo-backend:latest | |
| docker push ${{ secrets.DOCKER_USERNAME }}/cicd-demo-frontend:latest | |
| docker push ${{ secrets.DOCKER_USERNAME }}/cicd-demo-backend:latest | |
| docker images |