-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Tecnativa/apply-templates
Apply templates
- Loading branch information
Showing
11 changed files
with
575 additions
and
34 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,10 @@ | ||
# Changes here will be overwritten by Copier; do NOT edit manually | ||
_commit: v0.1.0 | ||
_src_path: https://github.com/copier-org/autopretty.git | ||
ansible: false | ||
biggest_kbs: 1000 | ||
github: true | ||
js: false | ||
main_branches: | ||
- master | ||
python: true |
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,15 @@ | ||
# Changes here will be overwritten by Copier; do NOT edit manually | ||
_commit: v0.1.3 | ||
_src_path: https://github.com/Tecnativa/image-template.git | ||
dockerhub_image: tecnativa/whitelist | ||
image_platforms: | ||
- linux/386 | ||
- linux/amd64 | ||
main_branches: | ||
- master | ||
project_name: docker-whitelist | ||
project_owner: Tecnativa | ||
push_to_ghcr: true | ||
pytest: false | ||
python_versions: | ||
- "3.9" |
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,16 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.py] | ||
# For isort | ||
profile = black | ||
|
||
[*.{code-snippets,code-workspace,json,yaml,yml}{,.jinja}] | ||
indent_size = 2 |
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,4 @@ | ||
[flake8] | ||
ignore = E203, E501, W503, B950 | ||
max-line-length = 88 | ||
select = C,E,F,W,B |
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,110 @@ | ||
name: Build, Test & Deploy | ||
|
||
"on": | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- "v*" | ||
workflow_dispatch: | ||
|
||
env: | ||
LANG: "en_US.utf-8" | ||
LC_ALL: "en_US.utf-8" | ||
|
||
jobs: | ||
build-push: | ||
runs-on: ubuntu-20.04 | ||
services: | ||
registry: | ||
image: registry:2 | ||
ports: | ||
- 5000:5000 | ||
env: | ||
DOCKER_IMAGE_NAME: ${{ github.repository }} | ||
DOCKERHUB_IMAGE_NAME: tecnativa/whitelist | ||
PUSH: ${{ toJSON(github.event_name != 'pull_request') }} | ||
steps: | ||
# Set up Docker Environment | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
/tmp/.buildx-cache | ||
key: buildx|${{ secrets.CACHE_DATE }}|${{ runner.os }} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
with: | ||
driver-opts: network=host | ||
install: true | ||
# Build and push | ||
- name: Docker meta for local images | ||
id: docker_meta_local | ||
uses: crazy-max/ghaction-docker-meta@v1 | ||
with: | ||
images: localhost:5000/${{ env.DOCKER_IMAGE_NAME }} | ||
tag-edge: true | ||
tag-semver: | | ||
{{version}} | ||
{{major}} | ||
{{major}}.{{minor}} | ||
- name: Build and push to local (test) registry | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: | | ||
linux/386 | ||
linux/amd64 | ||
load: false | ||
push: true | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max | ||
labels: ${{ steps.docker_meta_local.outputs.labels }} | ||
tags: ${{ steps.docker_meta_local.outputs.tags }} | ||
# Next jobs only happen outside of pull requests and on main branches | ||
- name: Login to DockerHub | ||
if: ${{ fromJSON(env.PUSH) }} | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_LOGIN }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Login to GitHub Container Registry | ||
if: ${{ fromJSON(env.PUSH) }} | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.BOT_LOGIN }} | ||
password: ${{ secrets.BOT_TOKEN }} | ||
- name: Docker meta for public images | ||
if: ${{ fromJSON(env.PUSH) }} | ||
id: docker_meta_public | ||
uses: crazy-max/ghaction-docker-meta@v1 | ||
with: | ||
images: | | ||
ghcr.io/${{ env.DOCKER_IMAGE_NAME }} | ||
${{ env.DOCKERHUB_IMAGE_NAME }} | ||
tag-edge: true | ||
tag-semver: | | ||
{{version}} | ||
{{major}} | ||
{{major}}.{{minor}} | ||
- name: Build and push to public registry(s) | ||
if: ${{ fromJSON(env.PUSH) }} | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: | | ||
linux/386 | ||
linux/amd64 | ||
load: false | ||
push: true | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max | ||
labels: ${{ steps.docker_meta_public.outputs.labels }} | ||
tags: ${{ steps.docker_meta_public.outputs.tags }} |
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,15 @@ | ||
name: pre-commit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- uses: pre-commit/action@v2.0.0 |
Oops, something went wrong.