From 43843f91be65e01170dacb86c0fd87d62dc3d528 Mon Sep 17 00:00:00 2001 From: "Xuan (Sean) Hu" Date: Sun, 9 Jun 2024 07:49:36 +0800 Subject: [PATCH] chore: add names to GitHub Actions (#595) --- .github/workflows/ci.yml | 12 ++-- .github/workflows/devcontainer.yml | 24 +++++--- .github/workflows/readthedocs-preview.yml | 3 +- .github/workflows/release.yml | 55 ++++++++++++------- .gitlab/workflows/release.yml | 18 +++--- .../workflows/ci.yml.jinja | 12 ++-- .../workflows/devcontainer.yml.jinja | 24 +++++--- .../workflows/readthedocs-preview.yml.jinja | 3 +- .../workflows/release.yml.jinja | 55 ++++++++++++------- .../workflows/release.yml.jinja | 18 +++--- 10 files changed, 138 insertions(+), 86 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8117538..2fdc154b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,10 +15,12 @@ jobs: if: ${{ !cancelled() && ! failure() }} runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - name: Checkout repository + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 with: fetch-depth: 0 - - uses: pdm-project/setup-pdm@568ddd69406b30de1774ec0044b73ae06e716aa4 # v4 + - name: Set up PDM + uses: pdm-project/setup-pdm@568ddd69406b30de1774ec0044b73ae06e716aa4 # v4 with: cache: true python-version: ${{ matrix.python-version }} @@ -59,7 +61,8 @@ jobs: runs-on: ubuntu-22.04 steps: - run: env | sort - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - name: Checkout repository + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - name: Set up Git run: | git config --global user.name github-actions @@ -96,7 +99,8 @@ jobs: echo "# :warning: GITHUB_TOKEN is used for semantic-release" >> $GITHUB_STEP_SUMMARY echo "The GITHUB_TOKEN is used instead of a bot token or PAT and will not emit the released publish event for the released workflow." >> $GITHUB_STEP_SUMMARY fi - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - name: Checkout repository + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 with: fetch-depth: 0 persist-credentials: false diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml index 9b574802..98092700 100644 --- a/.github/workflows/devcontainer.yml +++ b/.github/workflows/devcontainer.yml @@ -26,13 +26,17 @@ jobs: runs-on: ubuntu-22.04 steps: - run: env | sort - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - - run: docker login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io - - run: | + - name: Checkout repository + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - name: Set up authentication + run: docker login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io + - name: Set up BuildKit + run: | docker context create builder docker buildx create builder --name container --driver docker-container --use docker buildx inspect --bootstrap --builder container - - run: | + - name: Build the dev container + run: | docker buildx build . \ --build-arg PYTHON_VERSION=${{ matrix.python-version }} \ --cache-from type=registry,ref=ghcr.io/${{ github.repository }}/dev-cache:py${{ matrix.python-version }} \ @@ -40,21 +44,25 @@ jobs: --load \ --tag ghcr.io/${{ github.repository }}/dev:py${{ matrix.python-version }} \ --target dev - - run: | + - name: Test the dev container + run: | docker run --rm \ -e CI=true \ -v ${PWD}:/workspace \ ghcr.io/${{ github.repository }}/dev:py${{ matrix.python-version }} \ make dev lint test doc build - - run: | + - name: Build the prod container + run: | docker buildx build . \ --build-arg PYTHON_VERSION=${{ matrix.python-version }} \ --file .devcontainer/Dockerfile \ --load \ --tag ghcr.io/${{ github.repository }}:py${{ matrix.python-version }} \ --target prod - - run: docker run --rm ghcr.io/${{ github.repository }}:py${{ matrix.python-version }} - - if: github.event_name != 'pull_request' + - name: Test the prod container + run: docker run --rm ghcr.io/${{ github.repository }}:py${{ matrix.python-version }} + - name: Push the dev container + if: github.event_name != 'pull_request' run: | docker buildx build . \ --build-arg PYTHON_VERSION=${{ matrix.python-version }} \ diff --git a/.github/workflows/readthedocs-preview.yml b/.github/workflows/readthedocs-preview.yml index f209074f..289b847f 100644 --- a/.github/workflows/readthedocs-preview.yml +++ b/.github/workflows/readthedocs-preview.yml @@ -6,7 +6,8 @@ jobs: documentation-links: runs-on: ubuntu-22.04 steps: - - uses: readthedocs/actions/preview@cc0920454cf03ca8a3fbd3cbaa2ce2e509e70636 # v1.2 + - name: Add Read the Docs preview's link to pull request + uses: readthedocs/actions/preview@cc0920454cf03ca8a3fbd3cbaa2ce2e509e70636 # v1.2 with: project-slug: ss-python on: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7708bdc7..6267699e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,10 +13,12 @@ jobs: pages-build: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - name: Checkout repository + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 with: fetch-depth: 0 - - uses: pdm-project/setup-pdm@568ddd69406b30de1774ec0044b73ae06e716aa4 # v4 + - name: Set up PDM + uses: pdm-project/setup-pdm@568ddd69406b30de1774ec0044b73ae06e716aa4 # v4 with: cache: true python-version: '3.12' @@ -45,13 +47,17 @@ jobs: runs-on: ubuntu-22.04 steps: - run: env | sort - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - - run: docker login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io - - run: | + - name: Checkout repository + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - name: Set up authentication + run: docker login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io + - name: Set up BuildKit + run: | docker context create builder docker buildx create builder --name container --driver docker-container --use docker buildx inspect --bootstrap --builder container - - run: | + - name: Build the dev container + run: | docker buildx build . \ --build-arg PYTHON_VERSION=${{ matrix.python-version }} \ --cache-from type=registry,ref=ghcr.io/${{ github.repository }}/dev-cache:py${{ matrix.python-version }} \ @@ -60,22 +66,15 @@ jobs: --tag ghcr.io/${{ github.repository }}/dev:py${{ matrix.python-version }} \ --tag ghcr.io/${{ github.repository }}/dev:py${{ matrix.python-version }}-${{ github.ref_name }} \ --target dev - - run: | + - name: Test the dev container + run: | docker run --rm \ -e CI=true \ -v ${PWD}:/workspace \ ghcr.io/${{ github.repository }}/dev:py${{ matrix.python-version }} \ make dev lint test doc build - - run: | - docker buildx build . \ - --build-arg PYTHON_VERSION=${{ matrix.python-version }} \ - --cache-to type=registry,ref=ghcr.io/${{ github.repository }}/dev-cache:py${{ matrix.python-version }},mode=max \ - --file .devcontainer/Dockerfile \ - --push \ - --tag ghcr.io/${{ github.repository }}/dev:py${{ matrix.python-version }} \ - --tag ghcr.io/${{ github.repository }}/dev:py${{ matrix.python-version }}-${{ github.ref_name }} \ - --target dev - - run: | + - name: Build the prod container + run: | docker buildx build . \ --build-arg SCM_VERSION=${{ github.ref_name }} \ --build-arg PYTHON_VERSION=${{ matrix.python-version }} \ @@ -84,8 +83,20 @@ jobs: --tag ghcr.io/${{ github.repository }}:py${{ matrix.python-version }} \ --tag ghcr.io/${{ github.repository }}:py${{ matrix.python-version }}-${{ github.ref_name }} \ --target prod - - run: docker run --rm ghcr.io/${{ github.repository }}:py${{ matrix.python-version }} - - run: | + - name: Test the prod container + run: docker run --rm ghcr.io/${{ github.repository }}:py${{ matrix.python-version }} + - name: Push the dev container + run: | + docker buildx build . \ + --build-arg PYTHON_VERSION=${{ matrix.python-version }} \ + --cache-to type=registry,ref=ghcr.io/${{ github.repository }}/dev-cache:py${{ matrix.python-version }},mode=max \ + --file .devcontainer/Dockerfile \ + --push \ + --tag ghcr.io/${{ github.repository }}/dev:py${{ matrix.python-version }} \ + --tag ghcr.io/${{ github.repository }}/dev:py${{ matrix.python-version }}-${{ github.ref_name }} \ + --target dev + - name: Push the prod container + run: | docker buildx build . \ --build-arg SCM_VERSION=${{ github.ref_name }} \ --build-arg PYTHON_VERSION=${{ matrix.python-version }} \ @@ -105,8 +116,10 @@ jobs: package-publish: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - - uses: pdm-project/setup-pdm@568ddd69406b30de1774ec0044b73ae06e716aa4 # v4 + - name: Checkout repository + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - name: Set up PDM + uses: pdm-project/setup-pdm@568ddd69406b30de1774ec0044b73ae06e716aa4 # v4 with: cache: true python-version: '3.12' diff --git a/.gitlab/workflows/release.yml b/.gitlab/workflows/release.yml index 89ed54d8..518dae27 100644 --- a/.gitlab/workflows/release.yml +++ b/.gitlab/workflows/release.yml @@ -61,15 +61,6 @@ container-publish: -v ${PWD}:/workspace \ ${CI_REGISTRY_IMAGE}/dev:py${PYTHON_VERSION} \ make dev lint test doc build - - | - docker buildx build . \ - --build-arg PYTHON_VERSION=${PYTHON_VERSION} \ - --cache-to type=registry,ref=${CI_REGISTRY_IMAGE}/dev-cache:py${PYTHON_VERSION},mode=max \ - --file .devcontainer/Dockerfile \ - --push \ - --tag ${CI_REGISTRY_IMAGE}/dev:py${PYTHON_VERSION} \ - --tag ${CI_REGISTRY_IMAGE}/dev:py${PYTHON_VERSION}-${CI_COMMIT_TAG} \ - --target dev - | docker buildx build . \ --build-arg SCM_VERSION=${CI_COMMIT_TAG} \ @@ -80,6 +71,15 @@ container-publish: --tag ${CI_REGISTRY_IMAGE}:py${PYTHON_VERSION}-${CI_COMMIT_TAG} \ --target prod - docker run --rm ${CI_REGISTRY_IMAGE}:py${PYTHON_VERSION} + - | + docker buildx build . \ + --build-arg PYTHON_VERSION=${PYTHON_VERSION} \ + --cache-to type=registry,ref=${CI_REGISTRY_IMAGE}/dev-cache:py${PYTHON_VERSION},mode=max \ + --file .devcontainer/Dockerfile \ + --push \ + --tag ${CI_REGISTRY_IMAGE}/dev:py${PYTHON_VERSION} \ + --tag ${CI_REGISTRY_IMAGE}/dev:py${PYTHON_VERSION}-${CI_COMMIT_TAG} \ + --target dev - | docker buildx build . \ --build-arg SCM_VERSION=${CI_COMMIT_TAG} \ diff --git a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/ci.yml.jinja b/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/ci.yml.jinja index 0d7babb8..a8d52096 100644 --- a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/ci.yml.jinja +++ b/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/ci.yml.jinja @@ -16,10 +16,12 @@ jobs: if: {{ '${{ !cancelled() && ! failure() }}' }} runs-on: {{ '${{ matrix.os }}' }} steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - name: Checkout repository + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 with: fetch-depth: 0 - - uses: pdm-project/setup-pdm@568ddd69406b30de1774ec0044b73ae06e716aa4 # v4 + - name: Set up PDM + uses: pdm-project/setup-pdm@568ddd69406b30de1774ec0044b73ae06e716aa4 # v4 with: cache: true python-version: {{ '${{ matrix.python-version }}' }} @@ -87,7 +89,8 @@ jobs: runs-on: ubuntu-22.04 steps: - run: env | sort - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - name: Checkout repository + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - name: Set up Git run: | git config --global user.name github-actions @@ -127,7 +130,8 @@ jobs: echo "# :warning: GITHUB_TOKEN is used for semantic-release" >> $GITHUB_STEP_SUMMARY echo "The GITHUB_TOKEN is used instead of a bot token or PAT and will not emit the released publish event for the released workflow." >> $GITHUB_STEP_SUMMARY fi - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - name: Checkout repository + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 with: fetch-depth: 0 persist-credentials: false diff --git a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/devcontainer.yml.jinja b/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/devcontainer.yml.jinja index 4fbeb221..2c1c3cc7 100644 --- a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/devcontainer.yml.jinja +++ b/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/devcontainer.yml.jinja @@ -27,13 +27,17 @@ jobs: runs-on: ubuntu-22.04 steps: - run: env | sort - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - - run: docker login -u {{ '${{ github.actor }}' }} -p {{ '${{ secrets.GITHUB_TOKEN }}' }} ghcr.io - - run: | + - name: Checkout repository + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - name: Set up authentication + run: docker login -u {{ '${{ github.actor }}' }} -p {{ '${{ secrets.GITHUB_TOKEN }}' }} ghcr.io + - name: Set up BuildKit + run: | docker context create builder docker buildx create builder --name container --driver docker-container --use docker buildx inspect --bootstrap --builder container - - run: | + - name: Build the dev container + run: | docker buildx build . \ --build-arg PYTHON_VERSION={{ '${{ matrix.python-version }}' }} \ --cache-from type=registry,ref=ghcr.io/{{ '${{ github.repository }}' }}/dev-cache:py{{ '${{ matrix.python-version }}' }} \ @@ -41,21 +45,25 @@ jobs: --load \ --tag ghcr.io/{{ '${{ github.repository }}' }}/dev:py{{ '${{ matrix.python-version }}' }} \ --target dev - - run: | + - name: Test the dev container + run: | docker run --rm \ -e CI=true \ -v ${PWD}:/workspace \ ghcr.io/{{ '${{ github.repository }}' }}/dev:py{{ '${{ matrix.python-version }}' }} \ make dev lint test doc build - - run: | + - name: Build the prod container + run: | docker buildx build . \ --build-arg PYTHON_VERSION={{ '${{ matrix.python-version }}' }} \ --file .devcontainer/Dockerfile \ --load \ --tag ghcr.io/{{ '${{ github.repository }}' }}:py{{ '${{ matrix.python-version }}' }} \ --target prod - - run: docker run --rm ghcr.io/{{ '${{ github.repository }}' }}:py{{ '${{ matrix.python-version }}' }} - - if: github.event_name != 'pull_request' + - name: Test the prod container + run: docker run --rm ghcr.io/{{ '${{ github.repository }}' }}:py{{ '${{ matrix.python-version }}' }} + - name: Push the dev container + if: github.event_name != 'pull_request' run: | docker buildx build . \ --build-arg PYTHON_VERSION={{ '${{ matrix.python-version }}' }} \ diff --git a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/readthedocs-preview.yml.jinja b/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/readthedocs-preview.yml.jinja index d30c5206..5d704a6d 100644 --- a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/readthedocs-preview.yml.jinja +++ b/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/readthedocs-preview.yml.jinja @@ -6,7 +6,8 @@ jobs: documentation-links: runs-on: ubuntu-22.04 steps: - - uses: readthedocs/actions/preview@cc0920454cf03ca8a3fbd3cbaa2ce2e509e70636 # v1.2 + - name: Add Read the Docs preview's link to pull request + uses: readthedocs/actions/preview@cc0920454cf03ca8a3fbd3cbaa2ce2e509e70636 # v1.2 with: project-slug: {{ repo_name }} on: diff --git a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/release.yml.jinja b/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/release.yml.jinja index 2925af7d..3dcbc06b 100644 --- a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/release.yml.jinja +++ b/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/release.yml.jinja @@ -14,10 +14,12 @@ jobs: pages-build: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - name: Checkout repository + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 with: fetch-depth: 0 - - uses: pdm-project/setup-pdm@568ddd69406b30de1774ec0044b73ae06e716aa4 # v4 + - name: Set up PDM + uses: pdm-project/setup-pdm@568ddd69406b30de1774ec0044b73ae06e716aa4 # v4 with: cache: true python-version: '{{ default_py }}' @@ -46,13 +48,17 @@ jobs: runs-on: ubuntu-22.04 steps: - run: env | sort - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - - run: docker login -u {{ '${{ github.actor }}' }} -p {{ '${{ secrets.GITHUB_TOKEN }}' }} ghcr.io - - run: | + - name: Checkout repository + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - name: Set up authentication + run: docker login -u {{ '${{ github.actor }}' }} -p {{ '${{ secrets.GITHUB_TOKEN }}' }} ghcr.io + - name: Set up BuildKit + run: | docker context create builder docker buildx create builder --name container --driver docker-container --use docker buildx inspect --bootstrap --builder container - - run: | + - name: Build the dev container + run: | docker buildx build . \ --build-arg PYTHON_VERSION={{ '${{ matrix.python-version }}' }} \ --cache-from type=registry,ref=ghcr.io/{{ '${{ github.repository }}' }}/dev-cache:py{{ '${{ matrix.python-version }}' }} \ @@ -61,22 +67,15 @@ jobs: --tag ghcr.io/{{ '${{ github.repository }}' }}/dev:py{{ '${{ matrix.python-version }}' }} \ --tag ghcr.io/{{ '${{ github.repository }}' }}/dev:py{{ '${{ matrix.python-version }}' }}-{{ '${{ github.ref_name }}' }} \ --target dev - - run: | + - name: Test the dev container + run: | docker run --rm \ -e CI=true \ -v ${PWD}:/workspace \ ghcr.io/{{ '${{ github.repository }}' }}/dev:py{{ '${{ matrix.python-version }}' }} \ make dev lint test doc build - - run: | - docker buildx build . \ - --build-arg PYTHON_VERSION={{ '${{ matrix.python-version }}' }} \ - --cache-to type=registry,ref=ghcr.io/{{ '${{ github.repository }}' }}/dev-cache:py{{ '${{ matrix.python-version }}' }},mode=max \ - --file .devcontainer/Dockerfile \ - --push \ - --tag ghcr.io/{{ '${{ github.repository }}' }}/dev:py{{ '${{ matrix.python-version }}' }} \ - --tag ghcr.io/{{ '${{ github.repository }}' }}/dev:py{{ '${{ matrix.python-version }}' }}-{{ '${{ github.ref_name }}' }} \ - --target dev - - run: | + - name: Build the prod container + run: | docker buildx build . \ --build-arg SCM_VERSION={{ '${{ github.ref_name }}' }} \ --build-arg PYTHON_VERSION={{ '${{ matrix.python-version }}' }} \ @@ -85,8 +84,20 @@ jobs: --tag ghcr.io/{{ '${{ github.repository }}' }}:py{{ '${{ matrix.python-version }}' }} \ --tag ghcr.io/{{ '${{ github.repository }}' }}:py{{ '${{ matrix.python-version }}' }}-{{ '${{ github.ref_name }}' }} \ --target prod - - run: docker run --rm ghcr.io/{{ '${{ github.repository }}' }}:py{{ '${{ matrix.python-version }}' }} - - run: | + - name: Test the prod container + run: docker run --rm ghcr.io/{{ '${{ github.repository }}' }}:py{{ '${{ matrix.python-version }}' }} + - name: Push the dev container + run: | + docker buildx build . \ + --build-arg PYTHON_VERSION={{ '${{ matrix.python-version }}' }} \ + --cache-to type=registry,ref=ghcr.io/{{ '${{ github.repository }}' }}/dev-cache:py{{ '${{ matrix.python-version }}' }},mode=max \ + --file .devcontainer/Dockerfile \ + --push \ + --tag ghcr.io/{{ '${{ github.repository }}' }}/dev:py{{ '${{ matrix.python-version }}' }} \ + --tag ghcr.io/{{ '${{ github.repository }}' }}/dev:py{{ '${{ matrix.python-version }}' }}-{{ '${{ github.ref_name }}' }} \ + --target dev + - name: Push the prod container + run: | docker buildx build . \ --build-arg SCM_VERSION={{ '${{ github.ref_name }}' }} \ --build-arg PYTHON_VERSION={{ '${{ matrix.python-version }}' }} \ @@ -116,8 +127,10 @@ jobs: package-publish: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - - uses: pdm-project/setup-pdm@568ddd69406b30de1774ec0044b73ae06e716aa4 # v4 + - name: Checkout repository + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - name: Set up PDM + uses: pdm-project/setup-pdm@568ddd69406b30de1774ec0044b73ae06e716aa4 # v4 with: cache: true python-version: '{{ default_py }}' diff --git a/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/release.yml.jinja b/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/release.yml.jinja index 53ada57b..a4cbbde1 100644 --- a/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/release.yml.jinja +++ b/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/release.yml.jinja @@ -72,15 +72,6 @@ container-publish: -v ${PWD}:/workspace \ ${CI_REGISTRY_IMAGE}/dev:py${PYTHON_VERSION} \ make dev lint test doc build - - | - docker buildx build . \ - --build-arg PYTHON_VERSION=${PYTHON_VERSION} \ - --cache-to type=registry,ref=${CI_REGISTRY_IMAGE}/dev-cache:py${PYTHON_VERSION},mode=max \ - --file .devcontainer/Dockerfile \ - --push \ - --tag ${CI_REGISTRY_IMAGE}/dev:py${PYTHON_VERSION} \ - --tag ${CI_REGISTRY_IMAGE}/dev:py${PYTHON_VERSION}-${CI_COMMIT_TAG} \ - --target dev - | docker buildx build . \ --build-arg SCM_VERSION=${CI_COMMIT_TAG} \ @@ -91,6 +82,15 @@ container-publish: --tag ${CI_REGISTRY_IMAGE}:py${PYTHON_VERSION}-${CI_COMMIT_TAG} \ --target prod - docker run --rm ${CI_REGISTRY_IMAGE}:py${PYTHON_VERSION} + - | + docker buildx build . \ + --build-arg PYTHON_VERSION=${PYTHON_VERSION} \ + --cache-to type=registry,ref=${CI_REGISTRY_IMAGE}/dev-cache:py${PYTHON_VERSION},mode=max \ + --file .devcontainer/Dockerfile \ + --push \ + --tag ${CI_REGISTRY_IMAGE}/dev:py${PYTHON_VERSION} \ + --tag ${CI_REGISTRY_IMAGE}/dev:py${PYTHON_VERSION}-${CI_COMMIT_TAG} \ + --target dev - | docker buildx build . \ --build-arg SCM_VERSION=${CI_COMMIT_TAG} \