forked from rimamrahal/Mastodon-OpenScience
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch deployment to GitHub pages (#22)
* fix: Cleanup Cleanup HTML, CSS, JavaScript * feat: Add minimal GH Actions setup * fix: Build script * fix: Debug build script * fix: Further debug * fix: Change root dir Co-authored-by: David Adler <[email protected]>
- Loading branch information
1 parent
05aa4eb
commit 655f051
Showing
5 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# This workflow builds and uploads the page to the GitHub page associated with | ||
# this repository | ||
name: Build and deploy to Github pages | ||
# ADAPTED FROM https://github.com/actions/starter-workflows/blob/main/pages/static.yml | ||
|
||
on: | ||
# Runs on pushes targeting the default branch (in our case: main) | ||
push: | ||
branches: [$default-branch] | ||
# This toggle enables us to run the workflow manually | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Only one build at a time (cancel running ones if necessary) | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout the repo | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
|
||
# --- --- --- FROM HERE ON BUILDING | ||
- name: Setup NodeJS 16 | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '16' | ||
- name: Run build script | ||
# NOTE: We have to switch this out for the real build script once we have it | ||
run: | | ||
./scripts/build.sh | ||
# From here on only upload and deploy | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v2 | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
# Upload the "dist" directory | ||
path: './dist' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
#Mac system files | ||
# Mac system files | ||
.DS_Store | ||
|
||
# Build directory | ||
dist |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "mastodon-lists", | ||
"version": "1.0.0", | ||
"description": "A template to build hand-curated lists of accounts to follow", | ||
"main": "index.js", | ||
"repository": "https://github.com/trutzig89182/Mastodon-Sociologists.git", | ||
"author": "Hendrik Erz <[email protected]>", | ||
"license": "GPL-3.0", | ||
"scripts": { | ||
"build": "node scripts/build.js" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// DEBUG: DUMMY SCRIPT! We need this (respectively webpack) once we switch to | ||
// a dynamic page build. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
echo "Running in directory $(pwd)" | ||
echo "$(ls)" | ||
mkdir dist | ||
cp index.html ./dist | ||
cp tootformat.html ./dist | ||
cp instructions.html ./dist | ||
cp instructions.pdf ./dist | ||
|
||
# Copy the dirs | ||
cp -R ./resources ./dist/ | ||
cp -R ./assets ./dist/ |