2021-04-12 05:50:45 +05:30
|
|
|
nme: Docker Multi-Architecture Build
|
2020-10-02 00:37:32 +05:30
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- "**.md"
|
|
|
|
branches:
|
|
|
|
- dev-indep
|
|
|
|
|
|
|
|
jobs:
|
2020-10-31 00:15:55 +05:30
|
|
|
cpython-build-docker:
|
2020-10-02 00:37:32 +05:30
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-05-12 10:46:29 +05:30
|
|
|
- uses: actions/checkout@v2.3.4
|
2020-11-06 08:55:10 +05:30
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-10-02 00:37:32 +05:30
|
|
|
- name: Set up QEMU
|
2021-05-27 11:17:42 +05:30
|
|
|
uses: docker/setup-qemu-action@v1.2.0
|
2020-10-02 00:37:32 +05:30
|
|
|
with:
|
|
|
|
platforms: all
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
id: buildx
|
2021-05-12 10:46:32 +05:30
|
|
|
uses: docker/setup-buildx-action@v1.3.0
|
2020-10-02 00:37:32 +05:30
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
- name: Login to DockerHub
|
2021-05-12 10:46:17 +05:30
|
|
|
uses: docker/login-action@v1.9.0
|
2020-10-02 00:37:32 +05:30
|
|
|
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
|
2020-11-06 08:51:28 +05:30
|
|
|
- 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-02 00:37:32 +05:30
|
|
|
- name: cache docker cache
|
2021-05-28 11:00:13 +05:30
|
|
|
uses: actions/cache@v2.1.6
|
2020-10-02 00:37:32 +05:30
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}/cache
|
2020-10-31 14:40:05 +05:30
|
|
|
key: ${{ runner.os }}-docker-cpython-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/dockerhash.txt') }}
|
2020-10-02 00:37:32 +05:30
|
|
|
restore-keys: |
|
2020-10-31 14:40:05 +05:30
|
|
|
${{ runner.os }}-docker-cpython-
|
2020-10-02 00:37:32 +05:30
|
|
|
- name: Build and push
|
2021-05-27 11:17:38 +05:30
|
|
|
uses: docker/build-push-action@v2.5.0
|
2020-10-02 00:37:32 +05:30
|
|
|
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:
|
2021-05-12 10:46:29 +05:30
|
|
|
- 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
|
2021-05-27 11:17:42 +05:30
|
|
|
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
|
2021-05-12 10:46:32 +05:30
|
|
|
uses: docker/setup-buildx-action@v1.3.0
|
2020-10-31 00:15:55 +05:30
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
- name: Login to DockerHub
|
2021-05-12 10:46:17 +05:30
|
|
|
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
|
2020-11-06 08:51:28 +05:30
|
|
|
- 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
|
2021-05-28 11:00:13 +05:30
|
|
|
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
|
2021-05-27 11:17:38 +05:30
|
|
|
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:
|
2021-05-12 10:46:29 +05:30
|
|
|
- uses: actions/checkout@v2.3.4
|
2021-04-12 05:50:45 +05:30
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Set up QEMU
|
2021-05-27 11:17:42 +05:30
|
|
|
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
|
2021-05-12 10:46:32 +05:30
|
|
|
uses: docker/setup-buildx-action@v1.3.0
|
2021-04-12 05:50:45 +05:30
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
- name: Login to DockerHub
|
2021-05-12 10:46:17 +05:30
|
|
|
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
|
2021-05-28 11:00:13 +05:30
|
|
|
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
|
2021-05-27 11:17:38 +05:30
|
|
|
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
|