Introduce tests & GitHub Actions (#18) #1
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: CD | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
docker: | ||
name: Build and Push Docker Images | ||
runs-on: ubuntu-latest | ||
needs: [ci] # Docker image should be built after CI jobs are successful. | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
- name: Build and push Docker images using Docker Compose | ||
run: | | ||
docker-compose build | ||
docker-compose push |