diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 00000000..637ff331 --- /dev/null +++ b/.github/workflows/update.yml @@ -0,0 +1,31 @@ +name: Update Site + +on: + push: + branches: [master, actions-test] + +jobs: + update-site: + runs-on: ubuntu-latest + + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # added or changed files to the repository. + contents: write + + steps: + - uses: actions/checkout@v4 + - uses: taiki-e/install-action@v2 + with: + tool: just@1.16.0 + + - name: Setup tools + run: sudo apt-get install -y asciidoc + + + - name: Generate XML from Asciidoc + run: just generate + # Other steps that change files in the repository + + # Commit all changed files back to the repository + - uses: stefanzweifel/git-auto-commit-action@v5 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ee74ca27..00000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -language: c -sudo: false - -cache: - directories: - - $HOME/.stack - -addons: - apt: - packages: - - asciidoc - - ghc-7.10.3 - sources: - - hvr-ghc - -install: -- export PATH=$HOME/.local/bin:/opt/ghc/7.10.3/bin:$PATH -- mkdir -p $HOME/.local/bin -- curl -L https://github.com/commercialhaskell/stack/releases/download/v2.1.3/stack-2.1.3-linux-x86_64-static.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' - -script: -- rm -f book/generated-xml/* -- book/tools/generate.sh -- book/tools/validate.hs -- git diff -- | - if [ $TRAVIS_PULL_REQUEST != false ] - then - echo Not pushing diff for a pull request - elif [ -n "$(git status --porcelain)" ] - then - mkdir -p $HOME/.ssh - openssl aes-256-cbc -K $encrypted_92ac0cbbb1f3_key -iv $encrypted_92ac0cbbb1f3_iv -in id_rsa.enc -out id_rsa -d - mv id_rsa $HOME/.ssh - chmod 400 $HOME/.ssh/id_rsa - git config --global user.email "michael+travis@snoyman.com" - git config --global user.name "Travis job for yesodweb/yesodweb.com-content" - git add -A - git commit -m "Travis auto-generate XML files, $(date --utc --iso=sec)" - git push git@github.com:yesodweb/yesodweb.com-content.git HEAD:$TRAVIS_BRANCH - else - echo No changes present - fi diff --git a/justfile b/justfile new file mode 100644 index 00000000..6f112f88 --- /dev/null +++ b/justfile @@ -0,0 +1,4 @@ +generate: + rm -rf book/generated-xml + ./book/tools/generate.sh + ./book/tools/validate.hs