Remove snapshots #51
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: Build and Check | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build | |
uses: Logius-standaarden/Automatisering/.github/workflows/build.yml@main | |
check: | |
needs: build | |
name: Check | |
uses: Logius-standaarden/Automatisering/.github/workflows/check.yml@main | |
release: | |
needs: build | |
name: Release | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push'}} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Recover HTML | |
uses: actions/cache@v2 | |
with: | |
path: ~/static | |
key: ${{ github.run_id }} | |
- name: Gather files | |
run: | | |
rm -f *.md *.html | |
mv ~/static/snapshot.html index.html | |
mkdir content | |
shopt -s extglob | |
mv !(content) content | |
git clone https://user:${{ secrets.BEHEER }}@github.com/Logius-standaarden/publicatie.git | |
- name: Commit release | |
run: | | |
wget https://raw.githubusercontent.com/Logius-standaarden/Automatisering/main/scripts/release.py | |
python release.py | |
cd publicatie | |
git add -A | |
git config user.name "GitHub Action" | |
git config user.email "[email protected]" | |
git commit -m "Release: ${{ github.event.repository.name }}" | |
git push | |
preview: | |
needs: build | |
name: Preview | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Recover HTML | |
uses: actions/cache@v2 | |
with: | |
path: ~/static | |
key: ${{ github.run_id }} | |
- name: Gather files | |
run: | | |
rm index.html | |
mv ~/static/snapshot.html index.html | |
rm -f *.md *.pdf *.js snapshot.html | |
mkdir ~/content | |
mv ./* ~/content | |
git clone https://user:${{ secrets.BEHEER }}@github.com/Logius-standaarden/Publicatie-Preview.git | |
- name: Commit preview | |
run: | | |
cd Publicatie-Preview | |
rm -f -r ${{ github.event.repository.name }}/${{ github.head_ref }} | |
mkdir -p ${{ github.event.repository.name }}/${{ github.head_ref }} | |
mv ~/content/* ${{ github.event.repository.name }}/${{ github.head_ref }} | |
git add -A | |
git config user.name "GitHub Action" | |
git config user.email "[email protected]" | |
git commit -m "new preview build" | |
git push |