github action for building container, using cache

pull/7102/head
Nils Dijk 2023-08-01 13:01:09 +00:00
parent a90523afc5
commit 7e7d6d5caf
1 changed files with 42 additions and 0 deletions

42
.github/workflows/devcontainer.yml vendored Normal file
View File

@ -0,0 +1,42 @@
name: "Build devcontainer"
on:
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
steps:
# -
# name: Checkout
# uses: actions/checkout@v3
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/citusdata/citus-devcontainer
tags: |
type=ref,event=branch
type=sha
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: 'Login to GitHub Container Registry'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: "{{defaultContext}}:.devcontainer"
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max