new_release #67
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: Web Update | |
on: | |
repository_dispatch: | |
types: [new_release] | |
push: | |
branches: [main] | |
permissions: | |
contents: write | |
jobs: | |
gh-pages: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Get latest dnvm release | |
id: latest_version | |
uses: abatilo/release-info-action@v1.3.0 | |
with: | |
owner: dn-vm | |
repo: dnvm | |
- name: Build site | |
run: mkdir output && cp src/* output/ | |
- name: Replace version in template | |
env: | |
LATEST_TAG: ${{ steps.latest_version.outputs.latest_tag }} | |
run: sed -i'.bak' "s/__latestVersion__/${LATEST_TAG:1}/g" ./output/*.template | |
- name: Move templates to final name | |
run: mv ./output/install.sh.template ./output/install.sh && | |
mv ./output/install.ps1.template ./output/install.ps1 && | |
mv ./output/releases.json.template ./output/releases.json && | |
rm ./output/*.template.bak | |
- name: Deploy to gh-pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./output |