Update .gitea/workflows/deploy-edge.yml
This commit is contained in:
parent
a0c6c29a62
commit
c2fee6743a
1 changed files with 11 additions and 46 deletions
|
@ -6,54 +6,19 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.ELYSIUM_ORG_READ_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.ELYSIUM_ORG_READ_TOKEN }}
|
||||||
GARDEN_DEPLOY_ACTION: nile
|
|
||||||
OASIS_PROD_CONFIG: ${{ secrets.OASIS_PROD_CONFIG }}
|
|
||||||
OASIS_DIR: ${{ gitea.workspace}}/oasis
|
|
||||||
OASIS_BRANCH: master
|
|
||||||
KUBECONFIG_BASE64: ${{ secrets.KUBECONFIG_USW_EDGE }}
|
KUBECONFIG_BASE64: ${{ secrets.KUBECONFIG_USW_EDGE }}
|
||||||
|
OASIS_PROD_CONFIG: ${{ secrets.OASIS_PROD_CONFIG }}
|
||||||
|
GARDEN_DEPLOY_ACTION: nile
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-edge:
|
deploy-edge:
|
||||||
steps:
|
steps:
|
||||||
# Setup Envars
|
- name: Oasis Setup
|
||||||
- name: Setting Short Commit Sha
|
uses: https://gitea.dunemask.net/elysium/oasis-action@master
|
||||||
run: echo SHORT_COMMIT_SHA=$(echo $GITHUB_SHA | cut -c 1-6) >> $GITHUB_ENV
|
with:
|
||||||
- name: Setup Enviornment Variables
|
gitea-token: ${{ env.GITEA_TOKEN }}
|
||||||
run: |
|
kubeconfig: ${{ env.KUBECONFIG_BASE64 }}
|
||||||
echo CI_NAMESPACE=ci-$SHORT_COMMIT_SHA >> $GITHUB_ENV &&
|
oasis-prod-config: ${{ env. OASIS_PROD_CONFIG }}
|
||||||
echo REPO_GITEA_TOKEN_RO=$GITEA_TOKEN >> $GITHUB_ENV
|
- name: Deploy to Edge env
|
||||||
- name: "Using CI env $CI_NAMESPACE"
|
run: garden deploy $GARDEN_DEPLOY_ACTION --env usw-edge
|
||||||
run: echo $CI_NAMESPACE
|
working-directory: ${{ env.OASIS_WORKSPACE }}
|
||||||
# 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