ci: automatically deploy betabooru on push.
Make it so that on every push to the `betabooru` branch, the latest commit is automatically deployed to https://betabooru.donmai.us.
This commit is contained in:
46
.github/workflows/deploy-betabooru.yaml
vendored
Normal file
46
.github/workflows/deploy-betabooru.yaml
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
# Deploy the site to https://betabooru.donmai.us on every push to the `betabooru` branch.
|
||||||
|
|
||||||
|
name: Deploy Betabooru
|
||||||
|
|
||||||
|
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
|
on:
|
||||||
|
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_run
|
||||||
|
workflow_dispatch:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["Docker Build"]
|
||||||
|
types: [completed]
|
||||||
|
branches: [betabooru]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy-betabooru:
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency
|
||||||
|
concurrency: deploy-betabooru
|
||||||
|
|
||||||
|
# The Kubernetes API credentials are kept in the betabooru environment.
|
||||||
|
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idenvironment
|
||||||
|
environment:
|
||||||
|
name: betabooru
|
||||||
|
url: https://betabooru.donmai.us
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# https://github.com/marketplace/actions/kubectl-tool-installer
|
||||||
|
- name: Install Kubectl
|
||||||
|
uses: azure/setup-kubectl@v1
|
||||||
|
with:
|
||||||
|
version: v1.21.5
|
||||||
|
|
||||||
|
- name: Configure Kubectl
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.kube
|
||||||
|
echo "$KUBECONFIG_YAML" > ~/.kube/config
|
||||||
|
env:
|
||||||
|
KUBECONFIG_YAML: ${{secrets.KUBECONFIG_YAML}}
|
||||||
|
|
||||||
|
- name: Deploy to Betabooru
|
||||||
|
run: |
|
||||||
|
kubectl rollout restart deploy/betabooru
|
||||||
Reference in New Issue
Block a user