Skip to content

Commit

Permalink
build: use metadata and GH cache for all images
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Jan 12, 2024
1 parent d0445d6 commit bc40152
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,6 @@ jobs:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
tinygo/tinygo-dev
ghcr.io/${{ github.repository_owner }}/tinygo-dev
tags: |
type=sha,format=long
type=raw,value=latest
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -54,27 +44,43 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta for LLVM base image
id: metabase
uses: docker/metadata-action@v5
with:
images: |
tinygo/llvm-17
ghcr.io/${{ github.repository_owner }}/llvm-17
tags: |
type=sha,format=long
type=raw,value=latest
- name: Build and push LLVM base image
uses: docker/build-push-action@v5
with:
target: tinygo-llvm-build
context: .
push: true
tags: |
tinygo/llvm-17
tinygo/llvm-17:latest
ghcr.io/tinygo-org/llvm-17
ghcr.io/tinygo-org/llvm-17:latest
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.metabase.outputs.tags }}
labels: ${{ steps.metabase.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Docker meta for tinygo-dev
id: metadev
uses: docker/metadata-action@v5
with:
images: |
tinygo/tinygo-dev
ghcr.io/${{ github.repository_owner }}/tinygo-dev
tags: |
type=sha,format=long
type=raw,value=latest
- name: Build and push tinygo-dev image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.metadev.outputs.tags }}
labels: ${{ steps.metadev.outputs.labels }}
build-contexts: tinygo-llvm-build=docker-image://tinygo/llvm-17
cache-from: type=gha
cache-to: type=gha,mode=max
Expand Down

0 comments on commit bc40152

Please sign in to comment.