Create CI.

This commit is contained in:
James Murdza 2024-06-07 10:06:19 -04:00
parent 37c10f86ce
commit 1d3592a72d

25
.github/workflows/docker-image.yml vendored Normal file
View File

@ -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