Merge pull request #444 from Quetzacoalt91/use-bookworm #135
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: Publish images | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| list_base_images: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| versions: ${{ steps.set-versions.outputs.versions }} | |
| base_has_changed: ${{ steps.changes.outputs.base }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - id: set-versions | |
| run: echo "versions=$(ls base/images/ | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT | |
| - uses: dorny/paths-filter@v2 | |
| id: changes | |
| with: | |
| filters: | | |
| base: | |
| - 'base/**' | |
| list_prestashop_images: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| versions: ${{ steps.set-versions.outputs.versions }} | |
| steps: | |
| # Fetch versions to work for images | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: 3.9 | |
| - id: set-versions | |
| run: echo "versions=$(./get_json_versions.py)" >> $GITHUB_OUTPUT | |
| publish_base: | |
| runs-on: ubuntu-latest | |
| needs: list_base_images | |
| strategy: | |
| matrix: | |
| version: ${{ fromJson(needs.list_base_images.outputs.versions) }} | |
| steps: | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Enable multi-platform builds | |
| run: docker buildx create --name container --driver=docker-container | |
| - uses: actions/checkout@v2 | |
| - name: Base Images > Generate Tags | |
| run: ./generate_tags.sh | |
| working-directory: base | |
| - name: Base Images > Docker Build Tags | |
| run: DOCKER_REPOSITORY=${{ vars.DOCKER_BASE_REPOSITORY}} ./docker_tags.sh --version ${{ matrix.version }} | |
| if: ${{ github.event_name == 'pull_request' }} | |
| working-directory: base | |
| - name: Base Images > Docker Build & Force Push | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && needs.list_base_images.outputs.base_has_changed == 'true' }} | |
| run: DOCKER_REPOSITORY=${{ vars.DOCKER_BASE_REPOSITORY}} ./docker_tags.sh -p -f --version ${{ matrix.version }} | |
| working-directory: base | |
| publish_prestashop: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - list_prestashop_images | |
| - publish_base | |
| strategy: | |
| max-parallel: 2 | |
| fail-fast: false | |
| matrix: | |
| ps-version: ${{ fromJson(needs.list_prestashop_images.outputs.versions) }} | |
| steps: | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Enable multi-platform builds | |
| run: docker buildx create --name container --driver=docker-container | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python 3.8 | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: 3.9 | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| - name: Build & Push Docker images | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | |
| run: DOCKER_REPOSITORY=${{ vars.DOCKER_REPOSITORY}} ./prestashop_docker.py --quiet tag push ${{ matrix.ps-version }} --force | |