diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..a89861c --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,25 @@ +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