diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..93e4283 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: Build Docker Images + +on: + workflow_run: + workflows: + - Test Python backend + types: + - completed + workflow_dispatch: + +jobs: + build: + if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set lower case owner name + run: | + echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV} + env: + OWNER: '${{ github.repository_owner }}' + + - name: Build Docker image for backend + run: | + cd backend-flask + docker build -t ghcr.io/${OWNER_LC}/availabili-tf-backend-flask:latest . + docker push ghcr.io/${OWNER_LC}/availabili-tf-backend-flask:latest