Deploy #140
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
on: | |
workflow_run: | |
workflows: Test | |
branches: main | |
types: completed | |
jobs: | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
# Setup | |
- uses: actions/checkout@v4 | |
- run: yarn --frozen-lockfile | |
- name: Add elm, elm-tailwind-modules and elm-test to path | |
run: yarn bin >> $GITHUB_PATH | |
- name: Generate tailwind code | |
run: elm-tailwind-modules --dir ./gen --tailwind-config tailwind.config.js | |
- name: Create config file | |
run: cp src/TwitchConfig.elm.example src/TwitchConfig.elm | |
- name: Insert twitch client id | |
run: sed -i 's/twitch_client_id/${{ secrets.TWITCH_CLIENT_ID }}/g' src/TwitchConfig.elm | |
- name: Create dist folder | |
run: mkdir dist | |
- name: Build app | |
run: elm make src/Main.elm --optimize --output=dist/main.js | |
- name: Copy assets | |
run: cp -r assets/ dist/ | |
- run: cp index.html dist/ | |
- run: cp favicon.ico dist/ | |
- run: ls dist | |
# Deploy | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: 'dist' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |