Skip to content

Commit

Permalink
feat(ci): add build pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
aexvir committed Sep 16, 2020
1 parent f6bd65d commit 8a30b4b
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 5 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Commit
on: push

jobs:
container:
name: Container image
runs-on: ubuntu-latest

strategy:
matrix:
image: ["pre-commit"]

steps:
- uses: actions/checkout@v2

- id: metadata
name: Extract metadata
working-directory: ${{ matrix.image }}
run: |
export VERSION=$(grep -oP "^ENV\sversion\=(.*)" Dockerfile | cut -d "=" -f 2)
echo "::set-output name=version::$VERSION"
- name: Building ${{ matrix.image }} version ${{ steps.metadata.outputs.version }}
run: echo kiwicom/${{ matrix.image }}:${{ steps.metadata.outputs.version }}

- name: GitHub Package Registry
uses: aevea/action-kaniko@master
with:
registry: docker.pkg.github.com
password: ${{ secrets.GITHUB_TOKEN }}
image: ${{ matrix.image }}
cache: true
cache_registry: cache
tag: ${{ steps.metadata.outputs.version }}
tag_with_latest: true
extra_args: >
--context-sub-path ${{ matrix.image }}
--dockerfile ${{ matrix.image }}/Dockerfile
- name: Dockerhub
uses: aevea/action-kaniko@master
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
image: kiwicom/${{ matrix.image }}
cache: true
cache_registry: kiwicom/cache
tag: ${{ steps.metadata.outputs.version }}
tag_with_latest: true
extra_args: >
--context-sub-path ${{ matrix.image }}
--dockerfile ${{ matrix.image }}/Dockerfile
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ matrix.image }}-${{ steps.metadata.outputs.version }}
release_name: kiwicom/${{ matrix.image }}:${{ steps.metadata.outputs.version }}
draft: false
prerelease: false
10 changes: 5 additions & 5 deletions tox/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
FROM alpine:3

ENV PATH="$PATH:/root/.pyenv/bin:/root/.pyenv/shims"
ENV TOX_VERSION="3.15.2"
ENV TOX_VERSION="3.19.0"

RUN apk add --no-cache --virtual=.build-deps curl git linux-headers openssl-dev sqlite-dev readline-dev bzip2-dev ncurses-dev sqlite-dev patch xz-dev zlib-dev && \
apk add --no-cache --virtual=.run-deps bash build-base curl-dev openssl readline libffi libbz2 libffi-dev bzip2 ncurses sqlite sqlite-libs zlib xz postgresql-dev ca-certificates && \
curl --location https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash && \
pyenv update && \
pyenv install 2.7.18 && \
pyenv install 3.5.9 && \
pyenv install 3.6.10 && \
pyenv install 3.7.7 && \
pyenv install 3.8.3 && \
pyenv global 3.8.3 3.7.7 3.6.10 3.5.9 2.7.18 && \
pyenv install 3.6.11 && \
pyenv install 3.7.8 && \
pyenv install 3.8.5 && \
pyenv global 3.8.5 3.7.8 3.6.11 3.5.9 2.7.18 && \
pyenv rehash && \
pip install tox==$TOX_VERSION && \
apk del .build-deps && \
Expand Down

0 comments on commit 8a30b4b

Please sign in to comment.