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

Skip image build/push if it exists #11

Merged
merged 1 commit into from
Nov 24, 2023
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
38 changes: 25 additions & 13 deletions .github/workflows/publish-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,40 +35,52 @@ jobs:
platform:
- linux/amd64,linux/arm64
steps:
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Lotus ${{ matrix.version }} ${{ matrix.net.name }}
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=lotus-${{ matrix.version }}-${{ matrix.net.name }}
- name: Check if image exists
id: checker
run: |
if ! docker manifest inspect ${{ steps.meta.outputs.tags }}
then
echo "IMAGE_EXISTS=false" >> $GITHUB_ENV
fi
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
if: env.IMAGE_EXISTS == 'false'
with:
tool-cache: false
android: true
dotnet: true
haskell: true
- name: Checkout
uses: actions/checkout@v3
if: env.IMAGE_EXISTS == 'false'
with:
repository: filecoin-project/lotus
ref: ${{ matrix.version }}
path: lotus
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if: env.IMAGE_EXISTS == 'false'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
if: env.IMAGE_EXISTS == 'false'
with:
platforms: ${{ matrix.platform }}
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Lotus ${{ matrix.version }} ${{ matrix.net.name }}
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=lotus-${{ matrix.version }}-${{ matrix.net.name }}
- name: Build Lotus ${{ matrix.version }} ${{ matrix.net.name }}
uses: docker/build-push-action@v4
if: env.IMAGE_EXISTS == 'false'
env:
REGISTRY_CACHE_REF: ghcr.io/${{ github.repository }}:cache
with:
Expand Down