Optimize find_album_credits #299
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
permissions: | |
packages: write | |
contents: read | |
id-token: write | |
on: | |
push: | |
paths: | |
- "core/**" | |
- "proto/**" | |
- ".github/**" | |
pull_request: | |
paths: | |
- "core/**" | |
- "proto/**" | |
- ".github/**" | |
name: workflow | |
env: | |
IMAGE_NAME: ghcr.io/shedrachokonofua/lute-v4:${{ github.sha }} | |
IMAGE_NAME_ARM: ghcr.io/shedrachokonofua/lute-v4-arm:${{ github.sha }} | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- uses: moonrepo/setup-rust@v1 | |
- uses: arduino/setup-protoc@v3 | |
- name: Run Rust tests | |
run: cargo test | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Cache Docker layers | |
uses: actions/cache@v2 | |
with: | |
path: ${{ runner.workspace }}/docker-layers | |
key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile', '**/Dockerfile.arm') }} | |
restore-keys: ${{ runner.os }}-docker- | |
- name: Setup docker | |
run: | | |
docker info | |
docker buildx create --use --name builder --driver=docker-container --bootstrap | |
docker run --privileged --rm tonistiigi/binfmt --install all | |
- name: Build x86 Docker Image | |
run: | | |
echo "Image name: ${{ env.IMAGE_NAME }}" | |
docker buildx build --cache-to type=local,dest=${{ runner.workspace }}/docker-layers --cache-from type=local,src=${{ runner.workspace }}/docker-layers --platform=linux/amd64 -t ${{ env.IMAGE_NAME }} -f core/Dockerfile --load . | |
- name: Build ARM Docker Image | |
run: | | |
echo "Image name: ${{ env.IMAGE_NAME_ARM }}" | |
docker buildx build --cache-to type=local,dest=${{ runner.workspace }}/docker-layers --cache-from type=local,src=${{ runner.workspace }}/docker-layers --platform=linux/arm64 -t ${{ env.IMAGE_NAME_ARM }} -f core/Dockerfile.arm --load . | |
- name: Push Docker Images | |
if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
run: | | |
docker login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io | |
docker push ${{ env.IMAGE_NAME }} | |
docker push ${{ env.IMAGE_NAME_ARM }} |