Implement back-end with django #28
Workflow file for this run
This file contains hidden or 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: Images | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - back-end/** | |
| - front-end/** | |
| - test/** | |
| - docker-compose* | |
| - .github/workflows/images.yml | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - back-end/** | |
| - front-end/** | |
| - test/** | |
| - docker-compose* | |
| - .github/workflows/images.yml | |
| jobs: | |
| test: | |
| name: Test container images | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| test: | |
| - host-net | |
| - proxy-pass | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Test container images | |
| run: | | |
| docker compose -f docker-compose.test-${{ matrix.test }}.yml up --exit-code-from test | |
| - name: Store logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: acceptance-test-${{ matrix.test }}-logs | |
| path: out/ | |
| push: | |
| name: Push container images | |
| if: github.ref == 'refs/heads/main' | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Push container image to GitHub Container Registry | |
| run: | | |
| docker build back-end/ -t back-end | |
| docker build front-end/ -t front-end | |
| for tag in ${{ github.run_number }} latest; do | |
| docker tag back-end ghcr.io/${{ github.repository }}-api:$tag | |
| docker push ghcr.io/${{ github.repository }}-api:$tag | |
| docker tag front-end ghcr.io/${{ github.repository }}-ui:$tag | |
| docker push ghcr.io/${{ github.repository }}-ui:$tag | |
| done |