mirror of
https://github.com/yzernik/squeaknode.git
synced 2026-08-16 13:01:04 +02:00
Create main.yml (#554)
* Create main.yml Add the yaml file for the github action * Update main.yml Try build and push docker image * Update main.yml Fix image tag * Update main.yml Specify platforms in docker build action * Upgrade pip in dockerfile * Pin version of grpcio in requirements.txt * Install pip requirements with only-binary * Change grpcio version * Remove only-binary option for pip install * Update main.yml cache docker layers * Update main.yml Push version tags to dockerhub * Update main.yml export and import cache to local * Update main.yml Fix image name
This commit is contained in:
parent
d341d3cbc0
commit
f263dd60dd
4 changed files with 65 additions and 3 deletions
62
.github/workflows/main.yml
vendored
Normal file
62
.github/workflows/main.yml
vendored
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
# This is a basic workflow to help you get started with Actions
|
||||
|
||||
name: CI
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 10 * * *' # everyday at 10am
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
-
|
||||
name: Docker meta
|
||||
id: docker_meta
|
||||
uses: crazy-max/ghaction-docker-meta@v1
|
||||
with:
|
||||
images: yzernik/squeaknode
|
||||
tag-sha: true # add git short SHA as Docker tag
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
-
|
||||
name: Cache Docker layers
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-
|
||||
-
|
||||
name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
platforms: linux/arm64,linux/amd64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.docker_meta.outputs.tags }}
|
||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||
-
|
||||
name: Image digest
|
||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||
|
|
@ -10,7 +10,7 @@ ENV PATH="/opt/venv/bin:$PATH"
|
|||
|
||||
COPY requirements.txt /
|
||||
|
||||
RUN pip install psycopg2 && \
|
||||
RUN pip install --upgrade pip && \
|
||||
pip install -r requirements.txt
|
||||
|
||||
WORKDIR /app
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ flask-cors
|
|||
flask-login
|
||||
Flask-WTF
|
||||
googleapis-common-protos
|
||||
grpcio
|
||||
grpcio==1.34.0
|
||||
grpcio-tools
|
||||
importlib_resources==1.4.0
|
||||
mypy-protobuf
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -86,7 +86,7 @@ setup(
|
|||
'importlib_resources',
|
||||
'argparse',
|
||||
'googleapis-common-protos',
|
||||
'grpcio',
|
||||
'grpcio>=1.34.0',
|
||||
'grpcio-tools',
|
||||
'mypy-protobuf',
|
||||
'psycopg2',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue