This repository has been archived on 2022-06-28. You can view files and clone it, but cannot push or open issues or pull requests.
Yotter/.github/workflows/docker-build.yml

134 lines
4.7 KiB
YAML
Raw Permalink Normal View History

2021-04-12 05:50:45 +05:30
nme: Docker Multi-Architecture Build
on:
push:
paths-ignore:
- "**.md"
branches:
- dev-indep
jobs:
2020-10-31 00:15:55 +05:30
cpython-build-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
2020-11-06 08:55:10 +05:30
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v1.2.0
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1.3.0
with:
version: latest
- name: Login to DockerHub
uses: docker/login-action@v1.9.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
2020-10-11 00:42:03 +05:30
- name: Get hash of latest image
2020-10-11 00:44:00 +05:30
run: docker pull python:3-alpine && docker inspect --format='{{index .RepoDigests 0}}' python:3-alpine > dockerhash.txt
- name: Write the current version to a file
run: "{ git describe --tags --abbrev=0 & date +\"%d-%m-%y\" & git rev-list HEAD --max-count=1 --abbrev-commit;} > version.txt"
- name: cache docker cache
uses: actions/cache@v2.1.6
with:
path: ${{ github.workspace }}/cache
2020-10-31 14:40:05 +05:30
key: ${{ runner.os }}-docker-cpython-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/dockerhash.txt') }}
restore-keys: |
2020-10-31 14:40:05 +05:30
${{ runner.os }}-docker-cpython-
- name: Build and push
uses: docker/build-push-action@v2.5.0
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ytorg/yotter:latest
cache-from: type=local,src=cache
cache-to: type=local,dest=cache
2020-10-31 00:15:55 +05:30
pypy-build-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
2020-11-06 08:55:10 +05:30
with:
fetch-depth: 0
2020-10-31 00:15:55 +05:30
- name: Set up QEMU
uses: docker/setup-qemu-action@v1.2.0
2020-10-31 00:15:55 +05:30
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1.3.0
2020-10-31 00:15:55 +05:30
with:
version: latest
- name: Login to DockerHub
uses: docker/login-action@v1.9.0
2020-10-31 00:15:55 +05:30
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get hash of latest image
run: docker pull pypy:3-slim-buster && docker inspect --format='{{index .RepoDigests 0}}' pypy:3-slim-buster > dockerhash.txt
- name: Write the current version to a file
run: "{ git describe --tags --abbrev=0 & date +\"%d-%m-%y\" & git rev-list HEAD --max-count=1 --abbrev-commit;} > version.txt"
2020-10-31 00:15:55 +05:30
- name: cache docker cache
uses: actions/cache@v2.1.6
2020-10-31 00:15:55 +05:30
with:
path: ${{ github.workspace }}/cache
2020-10-31 14:40:05 +05:30
key: ${{ runner.os }}-docker-pypy-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/dockerhash.txt') }}
2020-10-31 00:15:55 +05:30
restore-keys: |
2020-10-31 14:40:05 +05:30
${{ runner.os }}-docker-pypy-
2020-10-31 00:15:55 +05:30
- name: Build and push
uses: docker/build-push-action@v2.5.0
2020-10-31 00:15:55 +05:30
with:
context: .
file: ./pypy.Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ytorg/yotter:pypy
cache-from: type=local,src=cache
cache-to: type=local,dest=cache
2021-04-12 05:50:45 +05:30
nginx-build-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
2021-04-12 05:50:45 +05:30
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v1.2.0
2021-04-12 05:50:45 +05:30
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1.3.0
2021-04-12 05:50:45 +05:30
with:
version: latest
- name: Login to DockerHub
uses: docker/login-action@v1.9.0
2021-04-12 05:50:45 +05:30
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get hash of latest image
run: docker pull nginx:mainline-alpine && docker inspect --format='{{index .RepoDigests 0}}' nginx:mainline-alpine > dockerhash.txt
- name: Write the current version to a file
run: "{ git describe --tags --abbrev=0 & date +\"%d-%m-%y\" & git rev-list HEAD --max-count=1 --abbrev-commit;} > version.txt"
- name: cache docker cache
uses: actions/cache@v2.1.6
2021-04-12 05:50:45 +05:30
with:
path: ${{ github.workspace }}/cache
key: ${{ runner.os }}-docker-nginx-${{ hashFiles('**/dockerhash.txt') }}
restore-keys: |
${{ runner.os }}-docker-nginx-
- name: Build and push
uses: docker/build-push-action@v2.5.0
2021-04-12 05:50:45 +05:30
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ytorg/nginx:latest
cache-from: type=local,src=cache
cache-to: type=local,dest=cache