Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to fix CI race condition again #1271

Merged
merged 4 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 69 additions & 2 deletions .github/workflows/build-melee.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build-melee
run-name: Build Melee
name: build
run-name: Build Melee & publish GitHub Pages

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

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

jobs:
build-make:
name: Make
Expand Down Expand Up @@ -148,3 +154,64 @@ jobs:
--user "$(id -u):$(id -g)" \
--volume "$PWD:/input:ro" \
"$REGISTRY/$IMAGE"

gen-pages:
name: Generate pages
runs-on: ubuntu-latest
needs: build-ninja
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: 0 additions & 77 deletions .github/workflows/publish-pages.yml

This file was deleted.

Loading