From 5f7c6ebdd72aaab2b1325368115984a26816c9c7 Mon Sep 17 00:00:00 2001 From: Pedro Crespo <32402063+pcrespov@users.noreply.github.com> Date: Mon, 24 Oct 2022 15:44:13 +0200 Subject: [PATCH] gh actions: fixes formatting, updates cache and renames file --- .../{github-ci.yml => build-test-publish.yml} | 28 ++++++------------- 1 file changed, 9 insertions(+), 19 deletions(-) rename {{cookiecutter.project_slug}}/.github/workflows/{github-ci.yml => build-test-publish.yml} (67%) diff --git a/{{cookiecutter.project_slug}}/.github/workflows/github-ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/build-test-publish.yml similarity index 67% rename from {{cookiecutter.project_slug}}/.github/workflows/github-ci.yml rename to {{cookiecutter.project_slug}}/.github/workflows/build-test-publish.yml index d400c76a..e32d485c 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/github-ci.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/build-test-publish.yml @@ -6,14 +6,14 @@ on: env: # secrets can be set in settings/secrets on github - DOCKER_REGISTRY: { { "${{ secrets.DOCKER_REGISTRY }}" } } - DOCKER_USERNAME: { { "${{ secrets.DOCKER_USERNAME }}" } } - DOCKER_PASSWORD: { { "${{ secrets.DOCKER_PASSWORD }}" } } + DOCKER_REGISTRY: {{ "${{ secrets.DOCKER_REGISTRY }}" }} + DOCKER_USERNAME: {{ "${{ secrets.DOCKER_USERNAME }}" }} + DOCKER_PASSWORD: {{ "${{ secrets.DOCKER_PASSWORD }}" }} jobs: build: name: building {{ cookiecutter.project_slug }} - runs-on: { { "${{ matrix.os }}" } } + runs-on: {{ "${{ matrix.os }}" }} strategy: matrix: python: [3.9] @@ -24,21 +24,11 @@ jobs: - name: setup python environment uses: actions/setup-python@v4 with: - python-version: { { "${{ matrix.python }}" } } + python-version: {{ "${{ matrix.python }}" }} + cache: "pip" + cache-dependency-path: "**/requirements*.txt" - name: show versions run: ./scripts/show_system_versions.bash - - uses: actions/cache@v3 - name: getting cached data - with: - path: ~/.cache/pip - key: - { - { - "${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}", - }, - } - restore-keys: | - {{ "${{ runner.os }}" }}-pip- - name: set owner variable run: echo "OWNER=${GITHUB_REPOSITORY%/*}" >> $GITHUB_ENV - name: set docker image tag @@ -55,12 +45,12 @@ jobs: - name: test run: make tests - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - name: deploy + name: push run: | ./scripts/dockerhub_login.bash make push - if: github.event_name == 'push' && github.ref != 'refs/heads/master' - name: deploy + name: push run: | ./scripts/dockerhub_login.bash make push-version