Skip to content

chore(deps): update dependency sentry-sdk to v2.16.0 (#105) #656

chore(deps): update dependency sentry-sdk to v2.16.0 (#105)

chore(deps): update dependency sentry-sdk to v2.16.0 (#105) #656

name: Test and deploy
on:
push:
branches:
- main
tags:
- v*
pull_request: {}
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dev: ['--dev'] # Running non-dev takes hours
env:
DEVFLAG: ${{ matrix.dev }}
steps:
- name: Print Docker Compose version
run: |
docker --version
docker compose version
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Run thunorbld.py init/testinit
run: |
if [[ $DEVFLAG == "--dev" ]]; then python thunorbld.py init; fi
if [[ $DEVFLAG == "" ]]; then python thunorbld.py testinit; fi
- name: Test suite
run: python thunorbld.py $DEVFLAG test
- name: Upload coverage
if: ${{ matrix.dev == '--dev' }}
run: codecov
deploy:
needs: build
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Set release or dev mode
id: release_mode
run: |
if [ "$GITHUB_REF" == "refs/heads/main" ]; then
echo "qs_branch=dev" >> $GITHUB_OUTPUT
echo "build_tags=alubbock/thunorweb:dev" >> $GITHUB_OUTPUT
else
echo "qs_branch=main" >> $GITHUB_OUTPUT
echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
echo "build_tags=alubbock/thunorweb:dev,alubbock/thunorweb:latest,alubbock/thunorweb:${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Checkout Thunor Web
uses: actions/checkout@v4
with:
submodules: true
- name: Checkout Quickstart Repo
uses: actions/checkout@v4
with:
repository: alubbock/thunor-web-quickstart
ref: ${{ steps.release_mode.outputs.qs_branch }}
token: ${{ secrets.API_TOKEN_GITHUB }}
path: thunor-web-quickstart
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: alubbock
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build containers and push
run: python thunorbld.py build --use-buildx --tags=${{ steps.release_mode.outputs.build_tags }} --push
- name: Update and push quickstart repo
run: |
set -e
if [ "$GITHUB_REF" != "refs/heads/main" ]; then
GITHUB_TAG=${GITHUB_REF/refs\/tags\//}
echo "GitHub Tag: $GITHUB_TAG"
fi
cd thunor-web-quickstart
cp ../thunorctl.py .
cp ../docker-compose.services.yml .
cp ../docker-compose.certbot.yml .
rm -rf config-examples
cp -r ../config-examples .
if [ -z "$GITHUB_TAG" ]; then
sed -i 's/thunorweb:latest/thunorweb:dev/' docker-compose.services.yml
echo "$GITHUB_SHA" > .release
else
sed -i "s/thunorweb:latest/thunorweb:$GITHUB_TAG/" docker-compose.services.yml
echo "$GITHUB_TAG" > .release
fi
echo "Contents of .release: $(cat .release)"
git add -A
git status
git config user.email "ci@alexlubbock.com"
git config user.name "GitHub Actions CI"
if [[ $GITHUB_TAG ]]; then
git commit -m "CI update: $GITHUB_TAG"
git tag "$GITHUB_TAG"
git push --tags
# Make another commit referencing "latest" at HEAD
sed -i "s/thunorweb:$GITHUB_TAG/thunorweb:latest/" docker-compose.services.yml
git add docker-compose.services.yml
fi
git commit -m "CI update: $GITHUB_SHA"
git push