From 1d3592a72d03a46be07c6e48cbd7d2880d5d97f7 Mon Sep 17 00:00:00 2001 From: James Murdza Date: Fri, 7 Jun 2024 10:06:19 -0400 Subject: [PATCH] Create CI. --- .github/workflows/docker-image.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/docker-image.yml 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