Skip to content

cicd

cicd #434

Workflow file for this run

name: cicd
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '0 0 * * *'
jobs:
build:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
strategy:
matrix:
flavor: [ lazydl, standalone ]
os: [ ubuntu, alpine ]
steps:
- uses: actions/checkout@v4
- uses: docker/metadata-action@v5
id: metadata
with:
images: runmymind/docker-android-sdk
flavor: |
latest=auto
prefix=
suffix=
tags: |
type=schedule,enable=true,priority=1000,prefix=${{ matrix.os }}-${{ matrix.flavor }}-,suffix=,pattern={{date 'YYYYMMDD'}}
type=sha,enable=true,priority=100,prefix=${{ matrix.os }}-${{ matrix.flavor }}-sha-,suffix=,format=short
type=ref,enable=true,priority=600,prefix=${{ matrix.os }}-${{ matrix.flavor }}-,suffix=,event=branch
type=ref,enable=true,priority=600,prefix=${{ matrix.os }}-${{ matrix.flavor }}-,suffix=,event=tag
type=ref,enable=true,priority=600,prefix=${{ matrix.os }}-${{ matrix.flavor }}-pr-,suffix=,event=pr
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') && matrix.os == 'ubuntu' && matrix.flavor == 'standalone' }}
type=raw,value=lazydl,enable=${{ github.ref == format('refs/heads/{0}', 'main') && matrix.os == 'ubuntu' && matrix.flavor == 'lazydl' }}
type=raw,value=standalone,enable=${{ github.ref == format('refs/heads/{0}', 'main') && matrix.os == 'ubuntu' && matrix.flavor == 'standalone' }}
type=raw,value=${{ matrix.os }}-${{ matrix.flavor }},enable={{is_default_branch}}
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: int128/kaniko-action@v1
with:
push: true
file: ./${{ matrix.os }}/${{ matrix.flavor }}/Dockerfile
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache: true
cache-repository: runmymind/docker-android-sdk/cache
kaniko-args: |
--use-new-run
--cleanup
--compressed-caching=false