Merge pull request #325 from acend/renovate/docker.io-floryn90-hugo-0.x #294
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
# changeme | |
# Change the following parts to your current installation | |
# - entire Docker Build steps accordingly to the amount of different versions or tags your building TRAINING_HUGO_ENV | |
# - Tags | |
# - Helm Target Namespace | |
# - Name of K8S Deployment to trigger and namespace | |
# - Secrets | |
# - QUAYIO_USERNAME and QUAYIO_TOKEN must be set accordingly to your registry, existing users must have access to the repos | |
# - KUBECONFIG content of the Kubeconfig File, Account must have access to the k8s namespace. It's used in the helm steps | |
name: Publish Main Version | |
on: | |
push: | |
branches: | |
- main | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- | |
name: Set up npm for linting | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- | |
name: Lint Markdown | |
run: npm ci && npm run mdlint | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- | |
name: Login to Quay.io Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAYIO_USERNAME }} | |
password: ${{ secrets.QUAYIO_TOKEN }} | |
- | |
name: Build Latest Version | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
# changeme | |
tags: | | |
quay.io/acend/hugo-training-template:latest | |
- | |
name: Build Puzzle Version | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
build-args: | | |
TRAINING_HUGO_ENV=puzzle | |
push: true | |
# changeme | |
tags: | | |
quay.io/acend/hugo-training-template:latest-puzzle | |
- | |
name: 'Install Helm' | |
uses: azure/setup-helm@v4 | |
with: | |
version: v3.6.2 | |
- | |
name: Install Kubectl | |
uses: azure/setup-kubectl@v4 | |
with: | |
version: v1.21.2 | |
- | |
name: Create KUBECONFIG | |
env: | |
KUBE_CONFIG: '${{ secrets.KUBECONFIG_K8S_ACEND }}' | |
run: | | |
mkdir -p $HOME/.kube | |
echo "$KUBE_CONFIG" > $HOME/.kube/config | |
- | |
name: Deploy Helm Release | |
env: | |
TRAINING_HELM_RELEASE: 'latest' | |
TRAINING_NAMESPACE: 'acend-hugo-training-template-prod' # changeme | |
TRAINING_VERSION: '${{ github.sha }}' | |
run: | | |
helm upgrade $TRAINING_HELM_RELEASE acend-training-chart --install --wait --kubeconfig $HOME/.kube/config --namespace=$TRAINING_NAMESPACE --set=app.name=$HELM_RELEASE --set=app.version=$TRAINING_VERSION --repo=https://acend.github.io/helm-charts/ --values=helm-chart/values.yaml --atomic | |
- | |
name: Redeploy Deployments | |
env: | |
TRAINING_HELM_RELEASE: 'latest' | |
TRAINING_HELM_NAME: 'acend-hugo-template' # changeme | |
TRAINING_NAMESPACE: 'acend-hugo-training-template-prod' # changeme | |
# changeme | |
run: | | |
kubectl rollout restart deployment/${TRAINING_HELM_RELEASE}-${TRAINING_HELM_NAME}-acend --kubeconfig $HOME/.kube/config --namespace $TRAINING_NAMESPACE | |
kubectl rollout restart deployment/${TRAINING_HELM_RELEASE}-${TRAINING_HELM_NAME}-puzzle --kubeconfig $HOME/.kube/config --namespace $TRAINING_NAMESPACE |