-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e60389
commit da7e8d2
Showing
1 changed file
with
20 additions
and
78 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,20 @@ | ||
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 | ||
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 | ||
publish: | ||
needs: build | ||
name: Publish (Logius) | ||
uses: Logius-standaarden/Automatisering/.github/workflows/publish.yml@main | ||
secrets: inherit |