Skip to content

Support gifs as well, and just reencode #54

Support gifs as well, and just reencode

Support gifs as well, and just reencode #54

Workflow file for this run

name: Build and push Docker image
on:
push:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
packages: write
if: github.repository == 'PluralKit/avatars'
steps:
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
- run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" | sed 's|/|-|g' >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64'
- name: Set up docker buildx
uses: docker/setup-buildx-action@v3
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=${{ env.BRANCH_NAME }}
type=raw,value=${{ github.sha }}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
flavor: |
latest=false
- name: Build Cache for Docker (target)
uses: actions/cache@v3
with:
path: rust-build-cache-target-amd64
key: ${{ runner.os }}-rust-build-cache-target-${{ hashFiles('**/Cargo.lock') }}-amd64
- name: Build Cache for Docker (target)
uses: actions/cache@v3
with:
path: rust-build-cache-target-arm64
key: ${{ runner.os }}-rust-build-cache-target-${{ hashFiles('**/Cargo.lock') }}-arm64
- name: Build Cache for Docker (registry)
uses: actions/cache@v3
with:
path: rust-build-cache-registry
key: ${{ runner.os }}-rust-build-cache-registry-${{ hashFiles('**/Cargo.lock') }}
- name: inject rust-build-cache into docker
uses: reproducible-containers/buildkit-cache-dance@v2.1.2
with:
cache-source: rust-build-cache-target-amd64
cache-target: /app/target/linux/amd64
- name: inject rust-build-cache into docker
uses: reproducible-containers/buildkit-cache-dance@v2.1.2
with:
cache-source: rust-build-cache-target-arm64
cache-target: /app/target/linux/arm64
- name: inject rust-build-cache into docker
uses: reproducible-containers/buildkit-cache-dance@v2.1.2
with:
cache-source: rust-build-cache-registry
cache-target: /usr/local/cargo/registry/
- uses: docker/build-push-action@v5
with:
# https://github.com/docker/build-push-action/issues/378
context: .
platforms: |-
linux/amd64
linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max