From 51da9e6cc69602cfa66c1ba54ce1c10dcc55a5f4 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 5 Apr 2024 08:17:39 +0300 Subject: [PATCH] Migrate to GitHub Actions --- .github/workflows/update.yml | 27 ++++++++++++++++++++++ .travis.yml | 43 ------------------------------------ justfile | 4 ++++ 3 files changed, 31 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/update.yml delete mode 100644 .travis.yml create mode 100644 justfile diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 00000000..7a2f8593 --- /dev/null +++ b/.github/workflows/update.yml @@ -0,0 +1,27 @@ +name: Update Site + +on: + push: + branches: [master, actions-test] + +jobs: + format-code: + 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: 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..41345831 --- /dev/null +++ b/justfile @@ -0,0 +1,4 @@ +generate: + rm -f book/generated-xml + ./book/tools/generate.sh + ./book/tools/validate.hs