Reflow README, add note on docker compose dev loop #11
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
# Build and Push to GHCR | |
name: Create and publish Docker image to GHCR, Create Release | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
[ | |
"api/**", | |
"dataproc/**", | |
"tests/**", | |
"config.py", | |
"Dockerfile", | |
"requirements.txt", | |
".github/**", | |
] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
TEST_IMAGE_TAG: test | |
jobs: | |
build-and-push-image-release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set variables | |
run: | | |
VER=$(cat VERSION) | |
echo "VERSION=$VER" >> $GITHUB_ENV | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to the Container registry | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build Test Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
load: true | |
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}-${{ env.TEST_IMAGE_TAG }} | |
- name: Run Test Suite | |
env: | |
AUTOPKG_VERSION: ${{ env.VERSION }}-${{ env.TEST_IMAGE_TAG }} | |
run: docker-compose -f .github/workflows/test/docker-compose-ci-test.yaml run test || docker-compose -f .github/workflows/test/docker-compose-ci-test.yaml logs dataproc | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
push: true | |
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} |