change k* files to sh #26
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
# This is a basic workflow to help you get started with Actions | |
name: CI-test-km | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the "dev" branch | |
push: | |
branches: [ "dev" ] | |
pull_request: | |
branches: [ "dev" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
env: | |
imagetag: "${{ github.event.client_payload.ref || github.ref_name }}" | |
jobs: | |
km_matrix: | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, ubuntu-20.04] | |
runs-on: ${{ matrix.os }} | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
# Runs km command using the runners shell | |
- name: Run km script | |
run: sudo ./km --apply | |
km_build: | |
name: build kube-tools | |
needs: km_matrix | |
runs-on: ubuntu-22.04 | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: "image tag" | |
run: echo "image tag set to '${{ env.imagetag }}'" | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
platforms: linux/amd64, linux/arm64 | |
context: . | |
file: Dockerfile | |
push: true | |
tags: | | |
jfvopensource/kubetools:${{ env.imagetag }} | |
# Run inline.sh | |
# replace source "./common" command by common file content | |
- name: Run inline.sh for each kube-tools script | |
run: | | |
./inline.sh --in-file km --out-file km.sh | |
./inline.sh --in-file kc --out-file kc.sh | |
./inline.sh --in-file kw --out-file kw.sh | |
./inline.sh --in-file klb --out-file klb.sh | |
# create artifact | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: kube-tools-artifact | |
path: | | |
km.sh | |
kc.sh | |
kw.sh | |
klb.sh | |
config | |
README.md | |
License | |