docs/.gitea/workflows/deploy-stg.yaml
James Brumond 0ef63ceace
All checks were successful
Deploy latest to staging environment / tag-image (push) Successful in 24s
Deploy latest to staging environment / deploy (push) Successful in 1m2s
cleanup; attempt stg deploy
2023-08-18 19:20:54 -07:00

50 lines
1.6 KiB
YAML

name: Deploy latest to staging environment
on:
# - workflow_dispatch
push:
branches:
- master
jobs:
tag-image:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: gitea.jbrumond.me
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Tag "latest" with "stg"
run: |
docker pull gitea.jbrumond.me/doc-utils/docs-web:latest
docker tag gitea.jbrumond.me/doc-utils/docs-web:latest gitea.jbrumond.me/doc-utils/docs-web:stg
docker push gitea.jbrumond.me/doc-utils/docs-web:stg
deploy:
runs-on: ubuntu-latest
container:
image: gitea.jbrumond.me/images/kubectl:1.28
needs:
- tag-image
env:
KUBERNETES_SERVER: https://nephthys.local.jbrumond.me:6443
KUBERNETES_TOKEN: ${{ secrets.K8S_WEB_NS_SERVICE_ACCT_TOKEN }}
KUBERNETES_CERT: ${{ secrets.K8S_WEB_NS_SERVICE_ACCT_CERT }}
steps:
- name: Configure kubectl and set credentials
run: /bin/kubectl-setup
- name: Deploy "stg" image to kubernetes staging (doc-utils-stg.home.jbrumond.me)
run: |
kubectl -n web set image "deployment/doc-utils-stg-deploy" "doc-utils-stg=gitea.jbrumond.me/doc-utils/docs-web:stg"
kubectl -n web rollout restart "deployment/doc-utils-stg-deploy"
kubectl -n web rollout status "deployment/doc-utils-stg-deploy"