Files
yolks/.github/workflows/bot.yml

86 lines
2.3 KiB
YAML

name: build bot
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 1"
push:
branches:
- master
paths:
- bot/**
jobs:
pushArm:
name: "yolks:bot_${{ matrix.tag }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tag:
- parkertron
- red
- sinusbot
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
with:
version: "v0.8.2"
buildkitd-flags: --debug
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: arm64,amd64
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.REGISTRY_TOKEN }}
- uses: docker/build-push-action@v3
with:
context: ./bot/${{ matrix.tag }}
file: ./bot/${{ matrix.tag }}/Dockerfile
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
push: true
tags: |
ghcr.io/parkervcp/yolks:bot_${{ matrix.tag }}
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
pushAmd:
name: "yolks:bot_${{ matrix.tag }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tag:
- bastion
steps:
- uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v1
with:
version: "v0.7.0"
buildkitd-flags: --debug
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.REGISTRY_TOKEN }}
- uses: docker/build-push-action@v2
with:
context: ./bot/${{ matrix.tag }}
file: ./bot/${{ matrix.tag }}/Dockerfile
platforms: linux/amd64
push: true
tags: |
ghcr.io/parkervcp/yolks:bot_${{ matrix.tag }}