Compare commits
20 commits
s3-backup
...
ep/Apr6-20
Author | SHA1 | Date | |
---|---|---|---|
![]() |
902de144dc | ||
636bb98d2f | |||
e8f5a00cef | |||
08b815286f | |||
7cbaae0be3 | |||
6f64a8a9ff | |||
cb90f85f92 | |||
c021ec21ba | |||
6b1260fa4b | |||
3d7e62eb30 | |||
a4697b2655 | |||
![]() |
fec0d92bbe | ||
![]() |
b59a89cf52 | ||
![]() |
e7920efd42 | ||
![]() |
a704cbfd10 | ||
![]() |
dbf8182e81 | ||
![]() |
72a9c62af4 | ||
f80938e7fa | |||
![]() |
1e632a3f91 | ||
56324c2d05 |
2 changed files with 115 additions and 1 deletions
39
README.md
39
README.md
|
@ -1,3 +1,40 @@
|
||||||
# Elysium Actions
|
# Elysium Actions
|
||||||
## About
|
## About
|
||||||
The actions are used by Elysium to run CI/CD tasks and this repo will be archived once Gitea supports private actions (See issue [Here](https://github.com/go-gitea/gitea/issues/24621) )
|
The actions are used by Elysium to run CI/CD tasks and this repo will be archived once Gitea supports private actions (See issue [Here](https://github.com/go-gitea/gitea/issues/24621))
|
||||||
|
|
||||||
|
## Actions
|
||||||
|
|
||||||
|
The actions available are:
|
||||||
|
- [S3 Backup](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/s3-backup/action.yml)
|
||||||
|
- [Oasis Deploy](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/oasis-deploy/action.yml)
|
||||||
|
- [Infisical Env](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/infisical-env/action.yml)
|
||||||
|
- [Elysium CI/CD](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/elysium-ci-cd/action.yml)
|
||||||
|
|
||||||
|
## Workflow Template
|
||||||
|
|
||||||
|
The example below demonstrates how to use the [oasis-deploy](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/oasis-deploy/action.yml) action.
|
||||||
|
|
||||||
|
```yml
|
||||||
|
name: Deploy Edge
|
||||||
|
run-name: ${{ gitea.actor }} Deploy Edge
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.ELYSIUM_ORG_READ_TOKEN }}
|
||||||
|
KUBECONFIG_BASE64: ${{ secrets.KUBECONFIG_USW_EDGE }}
|
||||||
|
GARDEN_DEPLOY_ACTION: nile
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy-edge:
|
||||||
|
steps:
|
||||||
|
- name: Oasis Setup
|
||||||
|
uses: https://gitea.dunemask.dev/elysium/elysium-actions@oasis-deploy
|
||||||
|
with:
|
||||||
|
gitea-token: ${{ env.GITEA_TOKEN }}
|
||||||
|
kubeconfig: ${{ env.KUBECONFIG_BASE64 }}
|
||||||
|
- name: Deploy to Edge env
|
||||||
|
run: garden deploy $GARDEN_DEPLOY_ACTION --force --force-build --env usw-edge
|
||||||
|
working-directory: ${{ env.OASIS_WORKSPACE }}
|
||||||
|
```
|
||||||
|
|
77
action.yml
Normal file
77
action.yml
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
name: 'Oasis Config Action'
|
||||||
|
description: 'Configure env for deploying apps using Oasis'
|
||||||
|
inputs:
|
||||||
|
kubeconfig:
|
||||||
|
description: 'A base64 encoded string of the kubeconfig to use. Required!'
|
||||||
|
required: true
|
||||||
|
gitea-token:
|
||||||
|
description: 'Gitea token for downloading repositories'
|
||||||
|
required: false
|
||||||
|
default: ${{ env.DEVOPS_GITEA_ELYSIUM_ORG_READ_TOKEN }} # Action can't read env, so we need to reset it later
|
||||||
|
garden-version:
|
||||||
|
description: 'Version of Garden to deploy'
|
||||||
|
required: false
|
||||||
|
default: 0.13.29
|
||||||
|
oasis-branch:
|
||||||
|
description: 'Branch of Oasis to use'
|
||||||
|
required: false
|
||||||
|
default: master
|
||||||
|
oasis-workspace:
|
||||||
|
descipriont: 'Workspace to setup Oasis'
|
||||||
|
required: false
|
||||||
|
default: ${{ gitea.workspace}}/oasis
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
# Set additional Envars
|
||||||
|
- name: Setting Short Commit Sha
|
||||||
|
run: echo SHORT_COMMIT_SHA=$(echo $GITHUB_SHA | cut -c 1-6) >> $GITHUB_ENV
|
||||||
|
- name: Setup Enviornment Variables
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo CI_NAMESPACE=ci-$SHORT_COMMIT_SHA >> $GITHUB_ENV
|
||||||
|
echo DEVOPS_GITEA_ELYSIUM_ORG_READ_TOKEN=${{ inputs.gitea-token }} >> $GITHUB_ENV
|
||||||
|
echo "Checking out Oasis"
|
||||||
|
# Checkout Oasis
|
||||||
|
- name: Checkout Oasis
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: "elysium/oasis"
|
||||||
|
path: ${{ inputs.oasis-workspace }}
|
||||||
|
token: ${{ env.DEVOPS_GITEA_ELYSIUM_ORG_READ_TOKEN }}
|
||||||
|
ref: ${{ inputs.oasis-branch }}
|
||||||
|
- name: Download Garden
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GARDEN_BIN_VERSION: ${{ inputs.garden-version }}
|
||||||
|
GARDEN_DIR: ${{ runner.temp }}/garden
|
||||||
|
run: |
|
||||||
|
# Install Garden
|
||||||
|
mkdir -p "$GARDEN_DIR"
|
||||||
|
cd "$GARDEN_DIR"
|
||||||
|
if ! [ -d "$GARDEN_BIN_VERSION" ]; then
|
||||||
|
echo "Downloading ${GARDEN_BIN_VERSION}..."
|
||||||
|
if [[ "$GARDEN_BIN_VERSION" = "latest" ]]; then
|
||||||
|
tag_param=""
|
||||||
|
else
|
||||||
|
tag_param="$GARDEN_BIN_VERSION"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
curl -sL https://get.garden.io/install.sh | bash -s -- $tag_param
|
||||||
|
echo PATH=$PATH:$HOME/.garden/bin >> $GITHUB_ENV
|
||||||
|
git config --global --add safe.directory $HOME/.garden/bin/static
|
||||||
|
echo "Finished intalling Garden!"
|
||||||
|
# Configure K&S
|
||||||
|
- name: Configure K8S
|
||||||
|
run: |
|
||||||
|
echo "Setup kubeconfig"
|
||||||
|
mkdir -p ~/.kube &&
|
||||||
|
echo ${{ inputs.kubeconfig }} | base64 -d > ~/.kube/config &&
|
||||||
|
chmod 700 ~/.kube/config
|
||||||
|
echo "Finished setting up kubeconfig"
|
||||||
|
- name: Export Envars
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# Export environment variables
|
||||||
|
echo OASIS_WORKSPACE=${{ inputs.oasis-workspace }} >> $GITHUB_ENV
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue