build-and-push2registry.yaml : correckt image names #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | |
- 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 | |
- 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 | |
- 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 |