Skip to content

Commit

Permalink
Integrate GitHub Action - Fix openfisca#284
Browse files Browse the repository at this point in the history
  • Loading branch information
martinez-hugo committed Feb 5, 2023
1 parent 5d42d58 commit 78c4991
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Main
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint:
container: node-lts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.3.0

- name: Lint Markdown files
run: make lint

build:
container: python:3.8
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.3.0

- name: Restore cache
uses: ylemkimon/cache-restore@v2.1.3
with:
key: dependency-cache-${{ hashFiles('**/requirements.txt') }}
path: /tmp/venv/openfisca_doc

- name: Create a virtualenv
run: |
mkdir -p /tmp/venv/openfisca_doc
python -m venv /tmp/venv/openfisca_doc
echo "source /tmp/venv/openfisca_doc/bin/activate" >> $BASH_ENV
- name: Install doc dependencies
run: make install

- name: Save cache
uses: actions/cache@v3.2.4
with:
key: dependency-cache-${{ hashFiles('**/requirements.txt') }}
path: /tmp/venv/openfisca_doc

- name: Test doc
run: make test-build

- name: Build doc
run: make html

- name: Serve doc
run: make prod &

- name: Check for internal dead links
run: wget --spider --recursive --page-requisites http://localhost:8000

- name: Upload artifact result for build job
uses: actions/upload-artifact@v3
with:
name: build-artifact
path: build

deploy:
container: python:3.8
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v3.3.0

- name: Download math result for job 1
uses: actions/download-artifact@v3
with:
name: build-artifact

- name: Publish openfisca.org/doc
run: ./publish.sh

0 comments on commit 78c4991

Please sign in to comment.