-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Fix GitLab Pages deploy, revert devconatiner workflow for bootstr…
…ap. (#298)
- Loading branch information
Showing
8 changed files
with
194 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: DevContainer | ||
concurrency: | ||
cancel-in-progress: true | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
jobs: | ||
dev-container-publish: | ||
permissions: | ||
contents: read | ||
packages: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: docker/setup-buildx-action@v3 | ||
- uses: docker/login-action@v3 | ||
with: | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
- name: Build and push dev container | ||
env: | ||
SOURCE_DATE_EPOCH: 0 | ||
uses: docker/build-push-action@v5 | ||
with: | ||
build-args: | | ||
PYTHON_VERSION=${{ matrix.python-version }} | ||
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:build-cache-dev-py${{ matrix.python-version }} | ||
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:build-cache-dev-py${{ matrix.python-version }},mode=max | ||
file: .devcontainer/Dockerfile | ||
provenance: false | ||
push: true | ||
tags: | | ||
ghcr.io/${{ github.repository }}:dev-py${{ matrix.python-version }} | ||
target: dev | ||
strategy: | ||
matrix: | ||
python-version: | ||
- '3.8' | ||
- '3.9' | ||
- '3.10' | ||
- '3.11' | ||
- '3.12' | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- .devcontainer/Dockerfile | ||
workflow_dispatch: null |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
dev-container-publish: | ||
image: docker:latest | ||
parallel: | ||
matrix: | ||
- PYTHON_VERSION: | ||
- '3.8' | ||
- '3.9' | ||
- '3.10' | ||
- '3.11' | ||
- '3.12' | ||
rules: | ||
- changes: | ||
- .devcontainer/Dockerfile | ||
if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH | ||
script: | ||
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} | ||
- docker context create builder | ||
- docker buildx create builder --name container --driver docker-container --use | ||
- docker buildx inspect --bootstrap --builder container | ||
- | | ||
docker buildx build . \ | ||
--build-arg PYTHON_VERSION=${PYTHON_VERSION} \ | ||
--cache-from type=registry,ref=${CI_REGISTRY_IMAGE}:build-cache-dev-py${PYTHON_VERSION} \ | ||
--cache-to type=registry,ref=${CI_REGISTRY_IMAGE}:build-cache-dev-py${PYTHON_VERSION},mode=max \ | ||
--file .devcontainer/Dockerfile \ | ||
--provenance false \ | ||
--push \ | ||
--tag ${CI_REGISTRY_IMAGE}:dev-py${PYTHON_VERSION} \ | ||
--tag ${CI_REGISTRY_IMAGE}:dev-py${PYTHON_VERSION}-${CI_COMMIT_TAG} \ | ||
--target dev | ||
services: | ||
- docker:dind | ||
stage: build | ||
variables: | ||
DOCKER_TLS_CERTDIR: /certs | ||
PYTHON_VERSION: ${PYTHON_VERSION} | ||
SOURCE_DATE_EPOCH: 0 |
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
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
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
58 changes: 58 additions & 0 deletions
58
...% if repo_host_type == 'github.com' %].github[% endif %]/workflows/devcontainer.yml.jinja
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
[% from pathjoin("includes", "version_compare.jinja") import version_between -%] | ||
name: DevContainer | ||
concurrency: | ||
cancel-in-progress: true | ||
group: {{ '${{ github.workflow }}-${{ github.ref }}' }} | ||
jobs: | ||
dev-container-publish: | ||
permissions: | ||
contents: read | ||
packages: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: docker/setup-buildx-action@v3 | ||
- uses: docker/login-action@v3 | ||
with: | ||
password: {{ '${{ secrets.GITHUB_TOKEN }}' }} | ||
registry: ghcr.io | ||
username: {{ '${{ github.actor }}' }} | ||
- name: Build and push dev container | ||
env: | ||
SOURCE_DATE_EPOCH: 0 | ||
uses: docker/build-push-action@v5 | ||
with: | ||
build-args: | | ||
PYTHON_VERSION={{ '${{ matrix.python-version }}' }} | ||
cache-from: type=registry,ref=ghcr.io/{{ '${{ github.repository }}' }}:build-cache-dev-py{{ '${{ matrix.python-version }}' }} | ||
cache-to: type=registry,ref=ghcr.io/{{ '${{ github.repository }}' }}:build-cache-dev-py{{ '${{ matrix.python-version }}' }},mode=max | ||
file: .devcontainer/Dockerfile | ||
provenance: false | ||
push: true | ||
tags: | | ||
ghcr.io/{{ '${{ github.repository }}' }}:dev-py{{ '${{ matrix.python-version }}' }} | ||
target: dev | ||
strategy: | ||
matrix: | ||
python-version: | ||
[%- if version_between("3.8", min_py, max_py) %] | ||
- '3.8' | ||
[%- endif %] | ||
[%- if version_between("3.9", min_py, max_py) %] | ||
- '3.9' | ||
[%- endif %] | ||
[%- if version_between("3.10", min_py, max_py) %] | ||
- '3.10' | ||
[%- endif %] | ||
[%- if version_between("3.11", min_py, max_py) %] | ||
- '3.11' | ||
[%- endif %] | ||
[%- if version_between("3.12", min_py, max_py) %] | ||
- '3.12' | ||
[%- endif %] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- .devcontainer/Dockerfile | ||
workflow_dispatch: null |
48 changes: 48 additions & 0 deletions
48
..._host_type == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/devcontainer.yml.jinja
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
[% from pathjoin("includes", "version_compare.jinja") import version_between -%] | ||
dev-container-publish: | ||
image: docker:latest | ||
parallel: | ||
matrix: | ||
- PYTHON_VERSION: | ||
[%- if version_between("3.8", min_py, max_py) %] | ||
- '3.8' | ||
[%- endif %] | ||
[%- if version_between("3.9", min_py, max_py) %] | ||
- '3.9' | ||
[%- endif %] | ||
[%- if version_between("3.10", min_py, max_py) %] | ||
- '3.10' | ||
[%- endif %] | ||
[%- if version_between("3.11", min_py, max_py) %] | ||
- '3.11' | ||
[%- endif %] | ||
[%- if version_between("3.12", min_py, max_py) %] | ||
- '3.12' | ||
[%- endif %] | ||
rules: | ||
- changes: | ||
- .devcontainer/Dockerfile | ||
if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH | ||
script: | ||
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} | ||
- docker context create builder | ||
- docker buildx create builder --name container --driver docker-container --use | ||
- docker buildx inspect --bootstrap --builder container | ||
- | | ||
docker buildx build . \ | ||
--build-arg PYTHON_VERSION=${PYTHON_VERSION} \ | ||
--cache-from type=registry,ref=${CI_REGISTRY_IMAGE}:build-cache-dev-py${PYTHON_VERSION} \ | ||
--cache-to type=registry,ref=${CI_REGISTRY_IMAGE}:build-cache-dev-py${PYTHON_VERSION},mode=max \ | ||
--file .devcontainer/Dockerfile \ | ||
--provenance false \ | ||
--push \ | ||
--tag ${CI_REGISTRY_IMAGE}:dev-py${PYTHON_VERSION} \ | ||
--tag ${CI_REGISTRY_IMAGE}:dev-py${PYTHON_VERSION}-${CI_COMMIT_TAG} \ | ||
--target dev | ||
services: | ||
- docker:dind | ||
stage: build | ||
variables: | ||
DOCKER_TLS_CERTDIR: /certs | ||
PYTHON_VERSION: ${PYTHON_VERSION} | ||
SOURCE_DATE_EPOCH: 0 |
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