Skip to content

Commit

Permalink
update-tailwind: remove tailwind folder and update deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
krtko1 committed Sep 19, 2023
1 parent 74266d6 commit 1a6ddb5
Show file tree
Hide file tree
Showing 15 changed files with 1,553 additions and 1,989 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tailwind/build.css linguist-generated
build.css linguist-generated
62 changes: 42 additions & 20 deletions .github/workflows/ghPages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,63 @@ on:
branches:
- master

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Set the job key. The key is displayed as the job name
# when a job name is not provided
gh-pages:
# Name the Job
name: Deploy to Github pages
# Set the type of machine to run on
# build job
build:
name: Build tailwind
runs-on: ubuntu-latest

steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code 🛎️
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Setup Pages
uses: actions/configure-pages@v3

- name: Install tailwind
run: cd tailwind && npm install tailwindcss@3.0.24 --no-save
run: npm install tailwindcss@experimental --no-save

- name: Build 🔧
run: |
cd tailwind
cat tailwind.css custom.css > tailwind.temp.css
npx tailwindcss build tailwind.temp.css -c tailwind.config.prod.js -o build.css
npx tailwindcss -i tailwind.temp.css -o build.css -m
- name: Remove dev css links
run: |
sed -i 's|<link href="tailwind/custom.css" rel="stylesheet">||g' *.html
sed -i "s|tailwind/build.css|tailwind/build.css?v=$(git log --format="%h" -n 1)|g" *.html
sed -i 's|<link href="custom.css" rel="stylesheet">||g' *.html
sed -i "s|build.css|build.css?v=$(git log --format="%h" -n 1)|g" *.html
- name: Deploy 🚀
uses: JamesIves/github-pages-[email protected]
- name: Upload artifact 🚀
uses: actions/upload-pages-artifact@v2
with:
BRANCH: gh-pages
FOLDER: . # The folder the action should deploy.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SINGLE_COMMIT: true
PRESERVE: true
# Upload entire repository
path: '.'


# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages 🚀
id: deployment
uses: actions/deploy-pages@v2
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Generate developer Tailwindcss build:

`bunx tailwindcss@experimental -i tailwind.css -o build.css`

This will produce all classes used by Tailwindcss.


## Generate production Tailwindcss build:

cat tailwind.css custom.css > tailwind.temp.css
bunx tailwindcss@experimental -i tailwind.temp.css -o build.css -m

This will produce classes only used in code (files are specified in `./tailwind.config.js`) and minify the resulting css.
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2020 P-MAT n.o.
Copyright (c) 2020 - 2022 P-MAT n.o.
Copyright (c) 2022 - present Trojsten o.z.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ Kockatý Kalendár je spoločná iniciatíva týchto organizácií, ktorá ponú
## Kontakt

Ak si našiel/-la chybu alebo máš otázku, napíš nám na [email protected] a my sa ti ozveme.


Loading

0 comments on commit 1a6ddb5

Please sign in to comment.