-
Notifications
You must be signed in to change notification settings - Fork 76
53 lines (50 loc) · 1.6 KB
/
docker.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Build Docker Images
on:
schedule:
- cron: '0 0 * * *' # Run Daily
workflow_dispatch:
env:
DOCKER_ORG: cormorack
GITHUB_SHA: ${{ github.sha }}
jobs:
docker-build:
name: ${{ matrix.image_name }}-build
runs-on: ubuntu-20.04
strategy:
matrix:
image_name: ["minioci", "http"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Retrieve test data
if: matrix.image_name == 'http'
uses: ./.github/actions/gdrive-rclone
env:
GOOGLE_SERVICE_JSON: ${{ secrets.GOOGLE_SERVICE_JSON }}
ROOT_FOLDER_ID: ${{ secrets.TEST_DATA_FOLDER_ID }}
- name: Set Docker Image Spec
run: |
DATE_TAG="$( date -u '+%Y.%m.%d' )"
IMAGE_SPEC="${{ env.DOCKER_ORG }}/${{ matrix.image_name }}"
echo "IMAGE_SPEC=${IMAGE_SPEC}" >> $GITHUB_ENV
echo "DATE_TAG=${DATE_TAG}" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
id: docker_build_push
uses: docker/build-push-action@v6
with:
context: ./
file: ./.ci_helpers/docker/${{ matrix.image_name }}.dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: |
${{ env.IMAGE_SPEC }}:${{ env.DATE_TAG }}
${{ env.IMAGE_SPEC }}:latest