Skip to content

Merge branch 'task/TEC-1417/adjust-backup-strategy-and-access' into d… #529

Merge branch 'task/TEC-1417/adjust-backup-strategy-and-access' into d…

Merge branch 'task/TEC-1417/adjust-backup-strategy-and-access' into d… #529

Workflow file for this run

name: Test
on:
workflow_dispatch:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
# Check out GitHub reportiory
- uses: actions/checkout@v4
# Set the tag for the build
- name: Set tag name
run: |
if [[ "${{ github.ref }}" == "refs/heads/develop" || "${{ github.base_ref }}" == "develop" ]]; then
echo "TAG=staging" >> $GITHUB_ENV
else
echo "TAG=prod" >> $GITHUB_ENV
fi
# Setup transcrypt so that we can read secrets
- name: Checkout transcrypt
uses: actions/checkout@v4
with:
repository: elasticdog/transcrypt
path: transcrypt
- name: Initialise transcrypt
run: ./transcrypt/transcrypt -c aes-256-cbc -p '${{ secrets.TRANSCRYPT_PASSWORD }}' --yes
- name: Build frontend container image
run: docker build -t clerk-webpack:local -f docker/Dockerfile.webpack .
# Build the clerk Docker image so that we can run tests
- name: Build container image
run: docker build -t anikalaw/clerk:${TAG} -f docker/Dockerfile .
# Run clerk unit tests
- name: Run unit tests
run: docker compose -f docker/docker-compose.ci.yml run --rm test pytest -vv
# If the tests passed and we're on master/develop, then login to DockerHub
- name: Login to DockerHub
if: success() && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master')
uses: docker/login-action@v3
with:
username: anikalaw
password: ${{ secrets.DOCKER_PASSWORD }}
# If the tests passed and we're on master/develop, then push the image to DockerHub
# This image will be used for the next deployment.
- name: Push container image
if: success() && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master')
run: docker push anikalaw/clerk:${TAG}