58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
name: Build and Push
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: '0 6 * * *'
|
|
|
|
env:
|
|
IMAGE_NAME: menci/archlinuxarm
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
target:
|
|
- tag: base
|
|
package-group: base
|
|
- tag: base-devel
|
|
package-group: base base-devel
|
|
name: ${{ matrix.target.tag }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
- name: Generate Tag List
|
|
run: |
|
|
echo "TAGS<<EOF" >> $GITHUB_ENV
|
|
|
|
DATE="$(date +'%Y%m%d')"
|
|
echo $IMAGE_NAME:$TAG >> $GITHUB_ENV
|
|
echo $IMAGE_NAME:$TAG-$DATE.$RUN_ID >> $GITHUB_ENV
|
|
if [[ "$TAG" == "base" ]]; then
|
|
echo $IMAGE_NAME:latest >> $GITHUB_ENV
|
|
fi
|
|
|
|
echo "EOF" >> $GITHUB_ENV
|
|
env:
|
|
TAG: ${{ matrix.target.tag }}
|
|
RUN_ID: ${{ github.run_id }}
|
|
- name: Build and Push
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ${{ env.TAGS }}
|
|
build-args: |
|
|
PACKAGE_GROUP=${{ matrix.target.package-group }}
|