Merge pull request #884 from acend/effortless #797
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
name: push_main | |
on: | |
push: | |
branches: main | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- | |
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 and Push Latest Version | |
id: docker_build | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: | | |
quay.io/acend/website-hugo:latest | |
- | |
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: | |
WEBSITE_HELM_RELEASE: 'latest' | |
WEBSITE_NAMESPACE: 'acend-website' | |
WEBSITE_VERSION: '${{ github.sha }}' | |
run: | | |
helm upgrade --install --wait --kubeconfig $HOME/.kube/config --namespace=$WEBSITE_NAMESPACE --set=app.name=$WEBSITE_HELM_RELEASE --set=app.version=$WEBSITE_VERSION --values=helm-chart/values.yaml --atomic $WEBSITE_HELM_RELEASE ./helm-chart | |
- | |
name: Redeploy Deployments | |
env: | |
WEBSITE_HELM_RELEASE: 'latest' | |
WEBSITE_NAMESPACE: 'acend-website' | |
run: | | |
kubectl rollout restart deployment/${WEBSITE_HELM_RELEASE}-acend-website --kubeconfig $HOME/.kube/config --namespace $WEBSITE_NAMESPACE |