Dispatch on main push #2
This file contains 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 publish Docker image | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: build image | |
run: docker build -t mohamedshawky/react-test -f ./client/Dockerfile.dev ./client | |
- name: test image | |
run: docker run -e CI=true mohamedshawky/react-test npm test -- --coverage | |
- name: build and push images | |
run: | | |
docker build -t mohamedshawky/multi-client ./client | |
docker build -t mohamedshawky/multi-nginx ./nginx | |
docker build -t mohamedshawky/multi-server ./server | |
docker build -t mohamedshawky/multi-worker ./worker | |
docker login -u mohamedshawky -p ${{ secrets.DOCKER_HUB_TOKEN }} | |
docker push mohamedshawky/multi-client | |
docker push mohamedshawky/multi-nginx | |
docker push mohamedshawky/multi-server | |
docker push mohamedshawky/multi-worker |