Skip to content

Commit

Permalink
fix: deploy to github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
winny- committed Sep 7, 2024
1 parent 46bd97c commit 6cd4c57
Showing 1 changed file with 35 additions and 21 deletions.
56 changes: 35 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Release
on:
workflow_run:
workflows:
- Build
branches:
- master
types:
- completed
# workflow_run:
# workflows:
# - Build
# branches:
# - master
# types:
# - completed
push:
tags:
- "v*.*.*"
Expand Down Expand Up @@ -35,7 +35,7 @@ jobs:
name: dot_love-${{ github.sha }}
path: ${{ steps.dot_love.outputs.DOT_LOVE }}
if-no-files-found: error
website:
webroot:
needs:
- dot_love # Use pre-built game.love via cachix
runs-on: ubuntu-latest
Expand All @@ -48,18 +48,31 @@ jobs:
with:
name: bismuthsoft
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build
- run: nix build .#super_rogue.web.src
- run: |
env | grep -o "^AWS_[^=]*"
echo $AWS_ACCESS_KEY_ID | wc -c
echo $AWS_SECRET_ACCESS_KEY | wc -c
src=$(nix eval --raw ".#super_rogue.web.src")/
dest=s3://winny-super-rogue/
nix run .#ci.s5cmd -- sync --acl public-read "$src" "$dest"
echo https://super-rogue.workinprogress.top/
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_KEY }}
printf 'WEB_SRC=%s\n' \
"$(nix eval --raw .#super_rogue.dot_love)/super_rogue.web.src \
>> "$GITHUB_OUTPUT"
id: web_src
# cf https://github.com/actions/upload-pages-artifact/blob/main/action.yml
- uses: actions/upload-pages-artifact@v4
with:
path: ${{ steps.web_src.outputs.WEB_SRC }}
website:
# cf https://github.com/actions/deploy-pages?tab=readme-ov-file#usage
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs:
- webroot
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
linux:
needs:
- dot_love
Expand All @@ -85,7 +98,7 @@ jobs:
build-deb: true
product-name: super-rogue
output-folder: ./dist
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist-linux
path: dist
Expand Down Expand Up @@ -147,7 +160,7 @@ jobs:
product-website: https://super-rogue.workinprogress.top
installer-languages: English.isl
output-folder: "./dist"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist-windows
path: dist
Expand Down Expand Up @@ -175,6 +188,7 @@ jobs:
uses: softprops/action-gh-release@v2
# if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: |
super_rogue.love
Expand Down

0 comments on commit 6cd4c57

Please sign in to comment.