SOCH DCAT-AP #120
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SOCH DCAT-AP | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
schedule: | |
- cron: '23 7 * * 5' | |
workflow_dispatch: | |
jobs: | |
SOCH_DCAT-AP: | |
runs-on: ${{ matrix.os }} | |
permissions: write-all | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: [3.8] | |
env: | |
MAIN_BRANCH: master | |
TARGET_BRANCH: gh-pages | |
PUBLISH_PATH: output | |
steps: | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Check out ${{ env.MAIN_BRANCH }} | |
if: ${{ success() }} | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.MAIN_BRANCH }} | |
path: ${{ env.MAIN_BRANCH }} | |
- name: Check out ${{ env.TARGET_BRANCH }} | |
if: ${{ success() }} | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.TARGET_BRANCH }} | |
path: ${{ env.TARGET_BRANCH }} | |
- name: Set up pipenv | |
if: ${{ success() }} | |
run: | | |
cd ${GITHUB_WORKSPACE}/${MAIN_BRANCH} | |
pip install pipenv && pipenv install --dev --three | |
- name: Build | |
if: ${{ success() }} | |
run: | | |
cd ${GITHUB_WORKSPACE}/${MAIN_BRANCH} | |
pipenv run python3 source/index.py | |
- name: Commit | |
if: ${{ success() }} | |
run: | | |
mv ${GITHUB_WORKSPACE}/${MAIN_BRANCH}/${PUBLISH_PATH}/*.rdf ${GITHUB_WORKSPACE}/${TARGET_BRANCH} | |
cd ${GITHUB_WORKSPACE}/${TARGET_BRANCH} | |
git config user.name github_action | |
git config user.email [email protected] | |
git config commit.gpgsign false | |
git add . | |
git status | |
git commit -m "Automated deploy of riksantikvarieambetet/soch-dcat-ap by ${GITHUB_ACTOR}" | |
git status | |
- name: Deploy | |
if: ${{ success() }} | |
run: | | |
cd ${GITHUB_WORKSPACE}/${TARGET_BRANCH} | |
git push --force --quiet https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git ${TARGET_BRANCH}:${TARGET_BRANCH} |