Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up docker build action #504

Merged
merged 7 commits into from
Apr 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,15 @@ jobs:
- run: echo "::set-output name=version::$(date +%Y-%m-%dT%H-%M)-$(echo ${{ github.sha }} | cut -c1-8)"
id: version

# Build amd64 only for testing, do not push.
- name: Build
- name: Build a test image on amd64 and cache
uses: docker/build-push-action@v2
with:
cache-to: type=inline
platforms: linux/amd64
cache-from: ghcr.io/femiwiki/mediawiki:latest
cache-to: mode=max,type=local,dest=/tmp/.buildx-cache
load: true
tags: |
ghcr.io/femiwiki/mediawiki:latest
ghcr.io/femiwiki/mediawiki:docker-test
ghcr.io/femiwiki/mediawiki:${{ steps.version.outputs.version }}
push: false
tags: ghcr.io/femiwiki/mediawiki:docker-test

- name: Initialize docker swarm and start services
run: |
Expand Down Expand Up @@ -123,11 +121,15 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
- name: Build a multi-platform docker image and push
uses: docker/build-push-action@v2
with:
cache-to: type=inline
platforms: linux/amd64,linux/arm64
cache-from: |
ghcr.io/femiwiki/mediawiki:latest
type=local,src=/tmp/.buildx-cache
cache-to: mode=max,type=inline
load: false
push: ${{ github.repository_owner == 'femiwiki' && github.ref == 'refs/heads/main' }}
tags: |
ghcr.io/femiwiki/mediawiki:latest
Expand Down