Skip to content

Commit

Permalink
Ok whatever
Browse files Browse the repository at this point in the history
  • Loading branch information
ribbanya committed Feb 20, 2024
1 parent 41074c3 commit fe73269
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 96 deletions.
82 changes: 71 additions & 11 deletions .github/workflows/build-melee.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
name: build-melee
run-name: Build Melee
run-name: Build Melee & publish GitHub Pages
name: publish-pages

on:
workflow_call:
inputs:
ghcr_username:
type: string
required: true
secrets:
ghcr_password:
required: true

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

env:
IMAGE_REPO: doldecomp/melee

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

jobs:
build-make:
name: Make
Expand Down Expand Up @@ -154,3 +153,64 @@ 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
85 changes: 0 additions & 85 deletions .github/workflows/publish-pages.yml

This file was deleted.

0 comments on commit fe73269

Please sign in to comment.