Skip to content

updated .github/workflows/build-and-push2registry.yaml #6

updated .github/workflows/build-and-push2registry.yaml

updated .github/workflows/build-and-push2registry.yaml #6

name: workflows starter
# env: is empty, see setup-env and the outputs there
on:
push: {}
workflow_dispatch: {}
jobs:
build_and_push_to_registry:
permissions:
packages: write
contents: read
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: false
# CNB are not multi-arch ready as of May 2022 so this is not needed
# It causes problems with this workflow so test later
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
###########################################
## shell
- name: Create tags based on git data
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}/shell
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value={{sha}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: shell-env
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
##################################
# ## perl
# - name: Create tags based on git data
# id: metaperl
# uses: docker/metadata-action@v5
# with:
# images: |
# ghcr.io/${{ github.repository }}/perl
# tags: |
# type=ref,event=branch
# type=ref,event=pr
# type=semver,pattern={{version}}
# type=semver,pattern={{major}}.{{minor}}
# type=raw,value=latest,enable={{is_default_branch}}
# type=raw,value={{sha}}
# - name: Build and push
# uses: docker/build-push-action@v5
# with:
# context: perl-env
# platforms: linux/amd64
# push: true
# tags: ${{ steps.metaperl.outputs.tags }}
# labels: ${{ steps.metaperl.outputs.labels }}
# cache-from: type=gha
# cache-to: type=gha,mode=max
#####################
# ## java8
# - name: Create tags based on git data
# id: metajava8
# uses: docker/metadata-action@v5
# with:
# images: |
# ghcr.io/${{ github.repository }}/java8
# tags: |
# type=ref,event=branch
# type=ref,event=pr
# type=semver,pattern={{version}}
# type=semver,pattern={{major}}.{{minor}}
# type=raw,value=latest,enable={{is_default_branch}}
# type=raw,value={{sha}}
# - name: Build and push
# uses: docker/build-push-action@v5
# with:
# context: java8-env
# platforms: linux/amd64
# push: true
# tags: ${{ steps.metajava8.outputs.tags }}
# labels: ${{ steps.metajava8.outputs.labels }}
# cache-from: type=gha
# cache-to: type=gha,mode=max
############################
# ## spacyamc
# - name: Create tags based on git data
# id: metaspacyamc
# uses: docker/metadata-action@v5
# with:
# images: |
# ghcr.io/${{ github.repository }}/spacyamc
# tags: |
# type=ref,event=branch
# type=ref,event=pr
# type=semver,pattern={{version}}
# type=semver,pattern={{major}}.{{minor}}
# type=raw,value=latest,enable={{is_default_branch}}
# type=raw,value={{sha}}
# - name: Build and push
# uses: docker/build-push-action@v5
# with:
# context: spacyamc-env
# platforms: linux/amd64
# push: true
# tags: ${{ steps.metaspacyamc.outputs.tags }}
# labels: ${{ steps.metaspacyamc.outputs.labels }}
# cache-from: type=gha
# cache-to: type=gha,mode=max
#############################
## noskeshell
- name: Create tags based on git data
id: metanoskeshell
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}/noskeshell
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value={{sha}}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: noskeshell-env
platforms: linux/amd64
push: true
tags: ${{ steps.metanoskeshell.outputs.tags }}
labels: ${{ steps.metanoskeshell.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max