name: Docker Image CI on: push: branches: [ "main" ] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Write .env file run: echo "${{secrets.FRONTEND_DOT_ENV}}" > ./frontend/.env - name: Login Dockerhub env: DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} run: echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin - name: Build the Docker image run: docker build -t jamesmurdza/sandbox . - name: Push to Dockerhub run: docker push jamesmurdza/sandbox:latest