Skip to content

Commit

Permalink
chore: Overhaul deploy workflow to push to LuaRocks and GHCR
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Mar 25, 2023
1 parent 87af3a3 commit 3f9aeef
Showing 1 changed file with 35 additions and 7 deletions.
42 changes: 35 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,44 @@
name: Deploy

on:
push:
branches:
- master
tags:
- latest
- v*
on: [ push, workflow_dispatch ]

jobs:

affected:
uses: sile-typesetter/.github/.github/workflows/list_affected_rockspecs.yml@master

build:
needs: affected
if: ${{ needs.affected.outputs.rockspecs }}
uses: sile-typesetter/.github/.github/workflows/test_build_rock.yml@master
with:
rockspecs: ${{ needs.affected.outputs.rockspecs }}

upload:
needs: [ affected, build ]
# Only run upload if:
# 1. We are on the canonical repository (no uploads from forks)
# 2. The current commit is either tagged or on the default branch (the workflow will upload dev/scm rockspecs any
# time they are touched, tagged ones whenever the edited rockspec and tag match)
# 3. Some rockspecs were changed — this implies the commit changing the rockspec is the same one that gets tagged
if: >-
${{
github.repository == 'sile-typesetter/fontproof' &&
( github.ref_name == 'master' || startsWith(github.ref, 'refs/tags/') ) &&
needs.affected.outputs.rockspecs
}}
uses: sile-typesetter/.github/.github/workflows/upload_to_luarocks.yml@master
with:
rockspecs: ${{ needs.affected.outputs.rockspecs }}
secrets:
apikey: ${{ secrets.LUAROCKS_SILETYPESETTER }}

ghcr:
if: >-
${{
github.repository == 'sile-typesetter/fontproof' &&
( github.ref_name == 'master' || startsWith(github.ref, 'refs/tags/') )
}}
strategy:
fail-fast: false
runs-on: ubuntu-22.04
Expand Down

0 comments on commit 3f9aeef

Please sign in to comment.