invidious-copy-2023-06-08/.github/workflows/container-release.yml
2023-05-21 21:09:47 +08:00

82 lines
2.2 KiB
YAML

name: Build and release container
on:
workflow_dispatch:
push:
schedule:
- cron: "22 22 22 * *" # Every mouth at 22:22 on 22
branches:
- "CICD"
paths-ignore:
- "*.md"
- LICENCE
- TRANSLATION
- invidious.service
- .git*
- .editorconfig
- screenshots/*
- .github/ISSUE_TEMPLATE/*
- .github/workflows/*
- kubernetes/**
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Crystal
uses: crystal-lang/install-crystal@v1.6.0
with:
crystal: 1.5.0
- name: Run lint
run: |
if ! crystal tool format --check; then
crystal tool format
git diff
exit 1
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to registry
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker AMD64 image without QUIC for Push Event
if: github.ref == 'refs/heads/CICD'
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64
push: true
tags: docker.io/john3box/invidious-loginonly:${{ github.sha }}-amd64,docker.io/john3box/invidious-loginonly:latest-amd64
build-args: |
"release=1"
"disable_quic=1"
- name: Build and push Docker ARM64 image without QUIC for Push Event
if: github.ref == 'refs/heads/CICD'
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile.arm64
platforms: linux/arm64/v8
push: true
tags: docker.io/john3box/invidious-loginonly:${{ github.sha }}-arm64,docker.io/john3box/invidious-loginonly:latest-arm64
build-args: |
"release=1"
"disable_quic=1"