Test, build, deploy #49
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: Test, build, deploy | |
env: | |
ENTRY: 24 | |
GH_PAGES_DOMAIN: blockchainweek.github.io | |
DENO_DIR: /home/runner/.deno-cache | |
on: | |
workflow_dispatch: | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
tag: ${{ env.TAG }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Cache Deno dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.DENO_DIR }} | |
key: ${{ hashFiles('utils') }} | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- uses: szenius/[email protected] | |
with: | |
timezoneLinux: "Europe/Berlin" | |
- run: sudo apt install -y webp | |
- run: make install | |
- run: make imgs | |
- run: "deno run --allow-run utils/tag.js >> $GITHUB_ENV" | |
- run: "echo \"Tag: ${{ env.TAG }}\"" | |
- run: "make tag=${{ env.TAG }}" | |
- run: find dist | |
- uses: montudor/action-zip@v1 | |
- run: "zip -qq -r release.zip dist" | |
- run: "touch dist/CNAME && echo \"${{ env.GH_PAGES_DOMAIN }}\" >> dist/CNAME" | |
- uses: actions/configure-pages@v4 | |
- uses: actions/upload-pages-artifact@v3 | |
with: | |
path: 'dist' | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: release | |
path: release.zip | |
deploy: | |
needs: [build] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
release: | |
needs: [build, deploy] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- run: "echo \"TAG=${{ needs.build.outputs.tag }}\" >> $GITHUB_ENV" | |
- run: "echo \"Tag: ${{ env.TAG }}\"" | |
- uses: actions/download-artifact@v4 | |
with: | |
name: release | |
- uses: montudor/action-zip@v1 | |
- run: unzip -qq release.zip | |
- run: "zip -qq -r ../bbw-${{ env.ENTRY }}-${{ env.TAG }}.zip ${{ env.ENTRY }}" | |
working-directory: ./dist | |
- uses: rickstaa/action-create-tag@v1 | |
with: | |
tag: "${{ env.TAG }}" | |
message: "Latest release" | |
github_token: '${{ secrets.GITHUB_TOKEN }}' | |
- uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: "${{ env.TAG }}" | |
name: "${{ env.TAG }}" | |
body: "This is a automated release." | |
draft: false | |
prerelease: false | |
files: | | |
bbw-${{ env.ENTRY }}-${{ env.TAG }}.zip |