build #22
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 | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
- name: Setup Pages | |
uses: actions/configure-pages@v1 | |
- name: Update data | |
run: | | |
mkdir -p _data/ | |
sudo apt update -qq | |
sudo apt install -qq libpcap-dev libpq-dev | |
git clone https://github.com/rapid7/metasploit-framework.git | |
pushd metasploit-framework/ | |
export BUNDLE_GEMFILE=$PWD/Gemfile | |
bundle install | |
bundle exec ruby -I lib/ ../scripts/copy_modules.rb -o ../modules ../_data/modules.yml | |
bundle exec ruby -I lib/ ../scripts/update_modules_data.rb -i ../_data/modules.yml | |
popd | |
rm -fr metasploit-framework/ | |
export BUNDLE_GEMFILE=$PWD/Gemfile | |
- name: Build | |
run: | | |
touch -a README.md | |
rm README.md | |
bundle install | |
bundle exec jekyll build | |
cp _site/README.md README.md | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
- name: Commit | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Ramon de C Valle" | |
git add -A | |
git commit -m "Auto commit changes" || true | |
git push origin main | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
name: Deploy | |
needs: build | |
permissions: | |
id-token: write | |
pages: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |