60 lines
1.7 KiB
YAML
60 lines
1.7 KiB
YAML
on:
|
|
push:
|
|
tags: ["*"]
|
|
|
|
env:
|
|
DEPLOY_RELEASE_NAME: "blog"
|
|
DEPLOY_IMAGE_URL: "gitea.le-memese.com/s3rius/blog"
|
|
DEPLOY_NAMESPACE: "s3rius"
|
|
|
|
jobs:
|
|
docker_build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: gitea.le-memese.com
|
|
username: ${{ gitea.actor }}
|
|
password: ${{ secrets.PACKAGE_PAT }}
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
file: ./Dockerfile
|
|
platforms: linux/amd64
|
|
tags: |
|
|
${{ env.DEPLOY_IMAGE_URL }}:latest
|
|
${{ env.DEPLOY_IMAGE_URL }}:${{ gitea.ref_name }}
|
|
deploy_helm:
|
|
runs-on: ubuntu-latest
|
|
needs: docker_build
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Setup helm
|
|
uses: azure/setup-helm@v4.3.0
|
|
- name: Deploy
|
|
run: |
|
|
echo "${{secrets.KUBE_CONFIG}}" > /tmp/kubeconfig
|
|
helm upgrade \
|
|
"${{ env.DEPLOY_RELEASE_NAME }}" \
|
|
'oci://gitea.le-memese.com/common/charts/py-app' \
|
|
--install \
|
|
--wait \
|
|
--atomic \
|
|
--kubeconfig "/tmp/kubeconfig" \
|
|
--namespace="${{ env.DEPLOY_NAMESPACE }}" \
|
|
--create-namespace \
|
|
--values=./values.yaml \
|
|
--version "0.1.0" \
|
|
--set-literal "image.tag=${{ gitea.ref_name }}" \
|
|
--set-literal "image.repository=${{ env.DEPLOY_IMAGE_URL }}"
|