Skip to content

Add workflows for the chart to CI #36

Add workflows for the chart to CI

Add workflows for the chart to CI #36

Workflow file for this run

name: Build and publish tags to ghcr.io
on:
push:
tags:
- v*
branches:
- master
pull_request:
branches:
- master
env:
WERF_STAGED_DOCKERFILE_VERSION: v2
jobs:
build:
name: build images for tag
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- uses: werf/actions/install@v1.2
- name: Login into ghcr.io
shell: bash
run: werf cr login -u ${{ github.actor }} -p ${{ github.token }} ghcr.io/${{ github.repository }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
uses: docker/metadata-action@v5.6.1
with:
images: ghcr.io/${{ github.repository }}/${{ matrix.name }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build Image
if: ${{ github.event_name == 'pull_request' }}
run: |
source "$(werf ci-env github --as-file)"
while IFS= read -r line; do export $line done <<< "$(jq -r '.labels | to_entries | to_entries[] | "WERF_EXPORT_ADD_LABEL_\(.key)=\(.value.key)=\(.value.value)"' <<< $DOCKER_METADATA_OUTPUT_JSON)"
env
werf build
# with:
# push: ${{ github.event_name == 'pull_request' }}
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
# build-args: |
# TAG=${{ github.ref_name }}
# platforms: linux/amd64,linux/arm64,linux/arm
# file: ./Dockerfile.${{ matrix.name }}