Skip to content

Commit

Permalink
Merge publish-pages into build-melee (#1267)
Browse files Browse the repository at this point in the history
  • Loading branch information
ribbanya authored Feb 20, 2024
1 parent 8577ba5 commit 4e62d75
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 84 deletions.
75 changes: 72 additions & 3 deletions .github/workflows/build-melee.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
name: build-melee
run-name: Build Melee
name: build
run-name: Build Melee & publish GitHub Pages

on: workflow_call
on:
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 @@ -145,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
81 changes: 0 additions & 81 deletions .github/workflows/publish-pages.yml

This file was deleted.

0 comments on commit 4e62d75

Please sign in to comment.