These folders contain the required resources to deploy the GitHub Actions self-hosted runners for the workflows running in Ubuntu OS.
/docker
/kubernetes
docker build -t $LOCAL_IMAGE_NAME:TAG .
docker tag $LOCAL_IMAGE_NAME LOCATION-docker.pkg.dev/PROJECT-ID/REPOSITORY/IMAGE:latest
gcloud auth configure-docker us-central1-docker.pkg.dev
docker push LOCATION-docker.pkg.dev/PROJECT-ID/REPOSITORY/IMAGE:latest
Create a .var.env file from the example.var.env file and replace the corresponding values:
Run the container
docker compose up
For the current implementation we are using Google Kubernetes Engine (GKE) as a container orchestration platform.
gcloud container clusters get-credentials $GCP_CLUSTER_NAME --zone $GCP_REGION --project $GCP_PROJECT-ID
kubectl create namespace $NAMESPACE
kubectl create secret generic $k8s_SECRET_NAME --from-file=key.json=$LOCAL_PATH --namespace $NAMESPACE
github-actions-secrets.yml file with its corresponding values encrypted in base64echo -n "$VARIABLE_VALUE" | base64
Replace in github-actions-deployment.yml file the $IMAGE_URL variable with the corresponding image URL: GCP_LOCATION-docker.pkg.dev/GCP_PROJECT_ID/REPOSITORY_NAME/IMAGE_NAME
In case you would like to create the deployment from scratch, run the run-k8s-deployment.sh script to execute the Kubernetes deployment in the GKE cluster.
kubectl config current-context./run-k8s-deployment.sh $NAMESPACE
kubectl config current-contextkubectl apply -f github-actions-$FILE_NAME.yml --namespace $NAMESPACE
delete-k8s-deployment.sh script with its corresponding namespace value../delete-k8s-deployment.sh $NAMESPACE