Skip to content

Generated by Lattyware/elm-fontawesome-generator #8

Generated by Lattyware/elm-fontawesome-generator

Generated by Lattyware/elm-fontawesome-generator #8

Workflow file for this run

name: Publish
on:
push:
tags:
- "*.*.*"
env:
GIT_TAG_NAME: ${{ github.ref_type == 'tag' && github.ref_name || '' }}
jobs:
publish-elm:
name: Publish elm package
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout elm-fontawesome repository.
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_TAG_NAME }}
- name: Set up elm.
uses: jorelali/setup-elm@v5
with:
elm-version: 0.19.1
- name: Publish package.
run: elm publish
publish-example:
name: Publish example
runs-on: ubuntu-latest
needs: [publish-elm]
permissions:
contents: read
steps:
- name: Checkout elm-fontawesome repository.
uses: actions/checkout@v4
- name: Setup buildx.
uses: docker/setup-buildx-action@v2
- name: Set up elm.
uses: jorelali/setup-elm@v5
with:
elm-version: 0.19.1
- name: Install the package.
run: |
echo Y | elm install "lattyware/elm-fontawesome"
- name: Build example.
uses: docker/bake-action@v4
with:
workdir: "example"
env:
FONTAWESOME_SOURCE: "package"
- name: Set up git to push.
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Checkout elm-fontawesome-example repository.
uses: actions/checkout@v4
with:
repository: "lattyware/elm-fontawesome"
ssh-key: ${{ secrets.EXAMPLE_DEPLOY_KEY }}
path: "publish"
- name: Replace elm-fontawesome-example.
working-directory: ./publish
run: |
rm -rf $(git ls-tree --full-tree --name-only HEAD)
cp -RT ../example .
- name: Push to elm-fontawesome-example.
working-directory: ./publish
run: |
if git diff --exit-code; then
echo "No changes to commit."
else
echo "Changes to commit."
git add -A
git commit -m "Generated by ${{ github.repository }}" -m "Commit: ${{ env.GIT_TAG_NAME || github.sha }}"
git tag -am "${GIT_TAG_NAME} Release" "${GIT_TAG_NAME}"
git push
git push origin "${GIT_TAG_NAME}"
fi
- name: Checkout elm-fontawesome-example pages repository.
uses: actions/checkout@v4
with:
repository: "lattyware/elm-fontawesome"
ssh-key: ${{ secrets.EXAMPLE_DEPLOY_KEY }}
ref: "gh-pages"
path: "pages"
- name: Replace elm-fontawesome-example dist.
working-directory: ./pages
run: |
rm -rf $(git ls-tree --full-tree --name-only HEAD)
cp -RT ../example/dist .
- name: Push to elm-fontawesome-example.
working-directory: ./pages
run: |
if git diff --exit-code; then
echo "No changes to commit."
else
git add -A
git commit -m "Generated by ${{ github.repository }}" -m "Commit: ${{ env.GIT_TAG_NAME || github.sha }}"
git push
fi