Skip to content

Commit

Permalink
Update to workflows to build only on the public branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mayo committed Jun 5, 2024
1 parent 74b62ca commit 72ab1cd
Showing 1 changed file with 59 additions and 52 deletions.
111 changes: 59 additions & 52 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,65 @@
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
version: 2
jobs:
workflows:
build:
working_directory: ~/repo

docker:
- image: cimg/python:3.11.1

steps:
- restore_cache:
key: git-v1-{{ .Branch }}

- checkout

- run:
name: Update git submodules
command: |
git submodule sync
git submodule update --init
- save_cache:
key: git-v1-{{ .Branch }}
paths:
- .git

- restore_cache:
key: venv-v1-{{ .Branch }}-{{ checksum "requirements.txt" }}

- restore_cache:
key: site-v3-{{ .Branch }}-webmention_cache-

- run:
name: Setup and update Python environment
command: |
python -m virtualenv venv
. venv/bin/activate
pip install -r requirements.txt
- save_cache:
key: venv-v1-{{ .Branch }}-{{ checksum "requirements.txt" }}
paths:
- ./venv

- run:
name: Build
command: |
eval $(openssl aes-256-cbc -k "${ENCRYPTION_KEY}" -md sha256 -pbkdf2 -in environment.env.enc -d |grep -vE '(^#|^\s*$)')
. venv/bin/activate
python build.py
- save_cache:
key: site-v3-{{ .Branch }}-webmention_cache-{{ checksum ".webmention_cache.json" }}
paths:
- .webmention_cache.json
jobs:
- build:
filters:
branches:
only:
- public

working_directory: ~/repo

docker:
- image: cimg/python:3.11.1

steps:
- restore_cache:
key: git-v1-{{ .Branch }}

- checkout

- run:
name: Update git submodules
command: |
git submodule sync
git submodule update --init
- save_cache:
key: git-v1-{{ .Branch }}
paths:
- .git

- restore_cache:
key: venv-v1-{{ .Branch }}-{{ checksum "requirements.txt" }}

- restore_cache:
key: site-v3-{{ .Branch }}-webmention_cache-

- run:
name: Setup and update Python environment
command: |
python -m virtualenv venv
. venv/bin/activate
pip install -r requirements.txt
- save_cache:
key: venv-v1-{{ .Branch }}-{{ checksum "requirements.txt" }}
paths:
- ./venv

- run:
name: Build
command: |
eval $(openssl aes-256-cbc -k "${ENCRYPTION_KEY}" -md sha256 -pbkdf2 -in environment.env.enc -d |grep -vE '(^#|^\s*$)')
. venv/bin/activate
python build.py
- save_cache:
key: site-v3-{{ .Branch }}-webmention_cache-{{ checksum ".webmention_cache.json" }}
paths:
- .webmention_cache.json


0 comments on commit 72ab1cd

Please sign in to comment.