Add .gitea/workflows/deploy-edge.yml (#5)
Reviewed-on: https://gitea.dunemask.net/elysium/nile/pulls/5
This commit is contained in:
parent
45b20ae2b0
commit
b0be364abf
1 changed files with 59 additions and 0 deletions
59
.gitea/workflows/deploy-edge.yml
Normal file
59
.gitea/workflows/deploy-edge.yml
Normal file
|
@ -0,0 +1,59 @@
|
|||
name: Deploy Edge
|
||||
run-name: ${{ gitea.actor }} Deploy Edge
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.ELYSIUM_ORG_READ_TOKEN }}
|
||||
GARDEN_DEPLOY_ACTION: deploy.nile
|
||||
OASIS_PROD_CONFIG: ${{ secrets.OASIS_PROD_CONFIG }}
|
||||
OASIS_DIR: ${{ gitea.workspace}}/oasis
|
||||
OASIS_BRANCH: master
|
||||
KUBECONFIG_BASE64: ${{ secrets.KUBECONFIG_USW_EDGE }}
|
||||
|
||||
jobs:
|
||||
oasis-testing:
|
||||
steps:
|
||||
# Setup Envars
|
||||
- name: Setting Short Commit Sha
|
||||
run: echo SHORT_COMMIT_SHA=$(echo $GITHUB_SHA | cut -c 1-6) >> $GITHUB_ENV
|
||||
- name: Setup Enviornment Variables
|
||||
run: |
|
||||
echo CI_NAMESPACE=ci-$SHORT_COMMIT_SHA >> $GITHUB_ENV &&
|
||||
echo REPO_GITEA_TOKEN_RO=$GITEA_TOKEN >> $GITHUB_ENV
|
||||
- name: "Using CI env $CI_NAMESPACE"
|
||||
run: echo $CI_NAMESPACE
|
||||
# Checkout Oasis
|
||||
- name: Checkout Oasis
|
||||
run: git clone --depth=1 --branch $OASIS_BRANCH "https://dunemask:$GITEA_TOKEN@gitea.dunemask.net/dunemask/oasis.git" $OASIS_DIR
|
||||
- run: echo "Cloned Oasis 🌴"
|
||||
- name: Install Kubectl
|
||||
run: |
|
||||
curl -LO https://storage.googleapis.com/kubernetes-release/release/\
|
||||
$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)\
|
||||
/bin/linux/amd64/kubectl && \
|
||||
chmod +x ./kubectl && \
|
||||
mv ./kubectl /usr/local/bin/kubectl
|
||||
# Install Garden
|
||||
- name: Install Garden 🌸
|
||||
run: |
|
||||
curl -sL https://get.garden.io/install.sh | bash &&
|
||||
ln -sfn $HOME/.garden/bin/garden /usr/local/bin/garden &&
|
||||
git config --global --add safe.directory $HOME/.garden/bin/static
|
||||
# Configure K&S
|
||||
- name: Configure K8S
|
||||
run: |
|
||||
mkdir -p ~/.kube &&
|
||||
echo "${KUBECONFIG_BASE64}" | base64 -d > ~/.kube/config &&
|
||||
chmod 700 ~/.kube/config
|
||||
- name: Configure Prod config
|
||||
run: |
|
||||
echo "${OASIS_PROD_CONFIG}" | base64 -d > garden-config/prod.yml
|
||||
working-directory: ${{ env.OASIS_DIR}}
|
||||
- name: Deploy to Edge env
|
||||
run: garden deploy $GARDEN_DEPLOY_ACTION --env usw-edge
|
||||
working-directory: ${{ env.OASIS_DIR }}
|
||||
- name: Status Alert
|
||||
if: always()
|
||||
run: echo "The Job ended with status ${{ job.status }}."
|
Loading…
Add table
Add a link
Reference in a new issue