Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
foxylion committed Feb 19, 2024
0 parents commit e2602d5
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: ci
on:
push:
branches:
- "*"
tags:
- "*"

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Packages
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/meisterplan/actions-k8s-deploy/actions-k8s-deploy:${{ github.ref_name }}
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM amazon/aws-cli:2.13.26

# Install common cli tools
RUN yum install -y curl make grep git tar zsh && yum clean all && rm -rf /var/cache/yum

# Install latest jq & yq version
RUN curl -Lo /usr/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 && chmod +x /usr/bin/jq
RUN curl -Lo /usr/bin/yq https://github.com/mikefarah/yq/releases/download/v4.34.1/yq_linux_amd64 && chmod +x /usr/bin/yq


# Install aws-iam-authenticator for k8s
ENV AWS_IAM_AUTH_VERSION=0.6.11
RUN curl -Lo /usr/bin/aws-iam-authenticator https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v${AWS_IAM_AUTH_VERSION}/aws-iam-authenticator_${AWS_IAM_AUTH_VERSION}_linux_amd64 && \
chmod +x /usr/bin/aws-iam-authenticator

# Install kubectl
ENV KUBECTL_VERSION=1.28.3
RUN curl -Lo /usr/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl && \
chmod +x /usr/bin/kubectl

# Install helm
ENV HELM_VERSION=3.13.1
RUN cd /tmp && \
curl -Lo helm.tgz https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz && \
tar xvfz helm.tgz && \
mv linux-amd64/helm /usr/bin/helm && \
rm -rf /tmp/*

COPY entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
14 changes: 14 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 'Kubernetes Deploy'
description: 'Deploy things to Kubernetes using a custom command'
inputs:
command:
description: 'Command that should be executed'
required: true
working-directory:
description: 'Directory where the command should be executed'
default: "."
runs:
using: 'docker'
image: 'docker://ghcr.io/meisterplan/actions-k8s-deploy/actions-k8s-deploy@master'
args:
- "cd ${{ inputs.working-directory }} && ${{ inputs.command }} && echo \"Hello World\""
3 changes: 3 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

/bin/bash -c "$@"

0 comments on commit e2602d5

Please sign in to comment.