This repository has been archived on 2024-09-13. You can view files and clone it, but cannot push or open issues or pull requests.
check-da-helm/.github/workflows/container-version.yaml

106 lines
3.1 KiB
YAML
Raw Normal View History

2023-01-16 20:05:07 +00:00
---
2023-02-14 21:16:34 +00:00
name: "Versioned container"
2023-01-16 20:05:07 +00:00
on:
push:
tags:
- "v*.*.*"
jobs:
2023-05-04 10:34:14 +00:00
prepare_base:
name: Prepare the base image
2023-01-16 20:05:07 +00:00
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set version variable
run: echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Set action link variable
run: echo "LINK=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
2023-02-14 21:16:34 +00:00
- name: Build base
2023-01-16 20:05:07 +00:00
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
2023-02-14 21:16:34 +00:00
ghcr.io/${{ github.repository }}-base:${{ env.TAG }}
labels: |
action_id=${{ github.action }}
action_link=${{ env.LINK }}
actor=${{ github.actor }}
sha=${{ github.sha }}
ref=${{ github.ref }}
build_containers:
name: Build final images
runs-on: ubuntu-latest
2023-05-04 10:34:14 +00:00
needs: prepare_base
strategy:
matrix:
target_image:
- helmfile
- helmfile-secrets
- argo
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set version variable
run: echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Set action link variable
run: echo "LINK=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@master
2023-02-14 21:16:34 +00:00
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
2023-02-14 21:16:34 +00:00
- name: Build ${{ matrix.target_image }}
2023-02-14 21:16:34 +00:00
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./dockerfiles
2023-05-04 10:32:47 +00:00
file: ./dockerfiles/Dockerfile-${{ matrix.target_image }}
2023-02-14 21:16:34 +00:00
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}-${{ matrix.target_image }}:${{ env.TAG }}
ghcr.io/${{ github.repository }}-${{ matrix.target_image }}:${{ env.TAG }}
2023-01-16 20:05:07 +00:00
labels: |
action_id=${{ github.action }}
action_link=${{ env.LINK }}
actor=${{ github.actor }}
sha=${{ github.sha }}
ref=${{ github.ref }}