Skip to content

Initial commit

Initial commit #2

Workflow file for this run

# This file is part of Kubernetes Log Fetcher.
#
# Copyright (C) 2023 Airbus CyberSecurity SAS
#
# Kubernetes Log Fetcher is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.
#
# Kubernetes Log Fetcher is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# Kubernetes Log Fetcher. If not, see <https://www.gnu.org/licenses/>.
name: CI
on:
push:
jobs:
docker_build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build docker
uses: docker/build-push-action@v5
with:
context: kubernetes-log-fetcher
tags: kubernetes-log-fetcher
load: true
- name: Save results
run: docker save kubernetes-log-fetcher | gzip > kubernetes-log-fetcher.docker.tar.gz
- name: Prepare package
run: zip kubernetes-log-fetcher.docker.zip COPYING LICENSE kubernetes-log-fetcher.docker.tar.gz
# Store build as artifact
- name: Archive docker images as artifact
uses: actions/upload-artifact@v4
with:
name: kubernetes-log-fetcher
path: kubernetes-log-fetcher.docker.zip
if-no-files-found: error
docker_release:
runs-on: ubuntu-latest
needs: docker_build
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: kubernetes-log-fetcher
- name: Extract artifact
run: unzip kubernetes-log-fetcher.docker.zip -d kubernetes-log-fetcher
- name: Load images
run: docker load --input kubernetes-log-fetcher/kubernetes-log-fetcher.docker.tar.gz
- name: Tag image
run: docker tag kubernetes-log-fetcher kubernetes-log-fetcher:${{ github.ref_name }}
- name: Save newly tagged image
run: docker save kubernetes-log-fetcher:${{ github.ref_name }} | gzip > kubernetes-log-fetcher-${{ github.ref_name }}.docker.tar.gz
- name: Prepare license files
run: mv kubernetes-log-fetcher/LICENSE kubernetes-log-fetcher/COPYING .
- name: Prepare release
run: zip kubernetes-log-fetcher-${{ github.ref_name }}.docker.zip LICENSE COPYING kubernetes-log-fetcher-${{ github.ref_name }}.docker.tar.gz
- name: Release
uses: softprops/action-gh-release@v1
with:
files: kubernetes-log-fetcher-${{ github.ref_name }}.docker.zip
fail_on_unmatched_files: true