test-continuous-deployment/.gitea/workflows/test-deployment.yml

64 lines
2.0 KiB
YAML
Raw Normal View History

2024-06-03 02:24:20 +00:00
name: Continuous Stack Deployment Test
on:
push:
branches: '*'
2024-06-06 17:29:49 +00:00
paths:
- '!**'
- '.gitea/workflows/triggers/test-deployment'
2024-06-06 17:50:26 +00:00
- '.gitea/workflows/test-deployment.yml'
2024-06-03 02:24:20 +00:00
jobs:
test:
name: "Deploy test stack"
runs-on: ubuntu-latest
steps:
- name: "Clone project repository"
2024-06-06 17:29:49 +00:00
uses: actions/checkout@v4
2024-06-06 17:45:38 +00:00
with:
2024-06-06 17:50:26 +00:00
path: 'deployment-tools'
2024-06-03 02:24:20 +00:00
# At present the stock setup-python action fails on Linux/aarch64
# Conditional steps below workaroud this by using deadsnakes for that case only
- name: "Install Python for ARM on Linux"
if: ${{ runner.arch == 'arm64' && runner.os == 'Linux' }}
uses: deadsnakes/action@v3.0.1
with:
python-version: '3.8'
- name: "Install Python cases other than ARM on Linux"
if: ${{ ! (runner.arch == 'arm64' && runner.os == 'Linux') }}
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: "Print Python version"
run: python3 --version
- name: "Install stack orchestrator"
2024-06-06 17:50:26 +00:00
run: ./deployment-tools/scripts/install-so.sh
2024-06-06 17:29:49 +00:00
- name: "Clone target stack"
uses: actions/checkout@v4
with:
repository: cerc-io/test-deployment-stack
2024-06-06 17:41:54 +00:00
ref: 'main'
path: 'test-deployment-stack'
2024-06-06 19:19:24 +00:00
- name: "Create fake deployment dir"
run: |
mkdir deployments
mkdir deployments/test-deployment
echo "Some data" > deployments/test-deployment/data.txt
- name: "Test uploading an artifact"
2024-06-06 19:21:36 +00:00
uses: actions/upload-artifact@v3
2024-06-06 19:19:24 +00:00
with:
name: test-deployment-data
path: |
deployments
2024-06-06 19:33:47 +00:00
- name: "Test download artifact"
uses: actions/download-artifact@v4
with:
name: deployments
path: new-deployments
2024-06-06 17:29:49 +00:00
- name: "Show checked out files"
run: ls -lR
2024-06-03 02:24:20 +00:00
- name: "Deploy test stack"
run: |
PATH=$PATH:~/bin
2024-06-06 17:52:19 +00:00
./deployment-tools/deploy/deploy-stack.sh