Skip to content

Commit

Permalink
Revert CI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ribbanya committed Feb 20, 2024
1 parent 47ec996 commit 6836242
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 70 deletions.
1 change: 1 addition & 0 deletions .github/packages/gen-pages/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ for file in "$src"/*; do
done

# progress
# BUG race condition between `build-melee` and `gen-pages`.
progress_url='https://progress.decomp.club/data/melee/GALE01?format=json&mode=all'
curl -s -L "$progress_url" -o "$lib/progress.json"

Expand Down
70 changes: 2 additions & 68 deletions .github/workflows/build.yml → .github/workflows/build-melee.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build
run-name: Build Melee & publish GitHub Pages
name: build-melee
run-name: Build Melee

on:
push:
Expand All @@ -9,11 +9,6 @@ on:
env:
IMAGE_REPO: doldecomp/melee

permissions:
contents: read
pages: write
id-token: write

jobs:
build-make:
name: Make
Expand Down Expand Up @@ -153,64 +148,3 @@ jobs:
--user "$(id -u):$(id -g)" \
--volume "$PWD:/input:ro" \
"$REGISTRY/$IMAGE"
gen-pages:
name: Generate pages
needs: build-ninja
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
OUTPUT: ${{github.workspace}}/output
steps:
- name: Get image name
env:
IMAGE_SUFFIX: gen-pages:latest
run: |
echo "IMAGE=$IMAGE_REPO/$IMAGE_SUFFIX" >> $GITHUB_ENV
- name: Checkout Melee repository
uses: actions/checkout@v3

- name: Log into container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull generator image
run: docker pull ${{ env.REGISTRY }}/${{ env.IMAGE }}

- name: Generate pages
run: |
mkdir -p "${{ env.OUTPUT }}"
docker run --rm \
--user "$(id -u):$(id -g)" \
--volume "$PWD:/input:ro" \
--volume "${{ env.OUTPUT }}:/output" \
${{ env.REGISTRY }}/${{ env.IMAGE }}
- name: Set up GitHub Pages
uses: actions/configure-pages@v4

- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ env.OUTPUT }}

deploy-pages:
concurrency:
group: deploy
cancel-in-progress: false
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: gen-pages
if: github.ref_name == github.event.repository.default_branch
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
77 changes: 77 additions & 0 deletions .github/workflows/publish-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
run-name: Publish GitHub pages
name: publish-pages

on:
push:
paths: [ "**" ]
pull_request:

env:
IMAGE_REPO: doldecomp/melee

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
gen-pages:
name: Generate pages
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
OUTPUT: ${{github.workspace}}/output
steps:
- name: Get image name
env:
IMAGE_SUFFIX: gen-pages:latest
run: |
echo "IMAGE=$IMAGE_REPO/$IMAGE_SUFFIX" >> $GITHUB_ENV
- name: Checkout Melee repository
uses: actions/checkout@v3

- name: Log into container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull generator image
run: docker pull ${{ env.REGISTRY }}/${{ env.IMAGE }}

- name: Generate pages
run: |
mkdir -p "${{ env.OUTPUT }}"
docker run --rm \
--user "$(id -u):$(id -g)" \
--volume "$PWD:/input:ro" \
--volume "${{ env.OUTPUT }}:/output" \
${{ env.REGISTRY }}/${{ env.IMAGE }}
- name: Set up GitHub Pages
uses: actions/configure-pages@v4

- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ env.OUTPUT }}

deploy-pages:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: gen-pages
if: github.ref_name == github.event.repository.default_branch
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 0 additions & 1 deletion tools/progress-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.1",
"private": true,
"scripts": {
"prepare": "svelte-kit sync",
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
Expand Down
2 changes: 1 addition & 1 deletion tools/progress-site/src/components/ProgressPanel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
const TROPHY_COUNT = 290;
function formatPercent(value: number): string {
return `${Math.round(value * 100) / 100}%`;
return `${Math.floor(value * 100) / 100}%`;
}
let completion = 0;
Expand Down

0 comments on commit 6836242

Please sign in to comment.