Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 1196-add-dose-to-me…
Browse files Browse the repository at this point in the history
…dium-and-let-to-medium
  • Loading branch information
Derstilon committed Oct 8, 2023
2 parents 02597da + 9a64be0 commit 6cfd7da
Show file tree
Hide file tree
Showing 11 changed files with 1,122 additions and 317 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Deploy documentation content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
pull_request:
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:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies for mkdocs
run: poetry --directory docs install
- name: Build site
run: poetry --directory docs run mkdocs build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact if on master
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: actions/upload-pages-artifact@v2
with:
path: 'site'
- name: Deploy to GitHub Pages if on master
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
id: deployment
uses: actions/deploy-pages@v2
8 changes: 4 additions & 4 deletions .github/workflows/manual_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,24 @@ jobs:
ref: ${{ steps.comment-branch.outputs.head_ref }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4.6.0
uses: docker/metadata-action@v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# see https://github.com/docker/build-push-action/issues/513#issuecomment-987951050
- name: Build and push Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand Down
32 changes: 24 additions & 8 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Node.js CI
on:
push:
branches: [master]
tags: ['v*']
pull_request:
branches: [master]

Expand Down Expand Up @@ -54,7 +55,7 @@ jobs:
deploy-to-github-registry:
needs: [build_and_test]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/master'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-web
Expand All @@ -72,24 +73,24 @@ jobs:
submodules: true

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4.6.0
uses: docker/metadata-action@v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# see https://github.com/docker/build-push-action/issues/513#issuecomment-987951050
- name: Build and push Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand All @@ -105,7 +106,6 @@ jobs:
deploy_gh_pages:
runs-on: ubuntu-latest
needs: [build_and_test]
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
Expand All @@ -125,13 +125,29 @@ jobs:
node-version: '18.x'
cache: 'npm'

- name: webfactory/ssh-agent 🖥️
- name: webfactory/ssh-agent for dev 🖥️
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: webfactory/[email protected]
with:
# Private SSH key to register in the SSH agent
ssh-private-key: ${{ secrets.WEBDEV }}

- name: Deploy 🚀
- name: Deploy to dev instance 🚀
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
git remote set-url origin [email protected]:yaptide/web_dev.git
npm run deploy -- -u "github-actions-bot <[email protected]>" -r "[email protected]:yaptide/web_dev.git"
- name: webfactory/ssh-agent for production 🖥️
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
uses: webfactory/[email protected]
with:
# Private SSH key to register in the SSH agent
ssh-private-key: ${{ secrets.WEBPROD }}

- name: Deploy to prod instance 🚀
# this action is being triggered on release tags (named v*)
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
run: |
git remote set-url origin [email protected]:yaptide/yaptide.github.io.git
npm run deploy -- -u "github-actions-bot <[email protected]>" -r "[email protected]:yaptide/yaptide.github.io.git"
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Technical documentation of the project
Loading

0 comments on commit 6cfd7da

Please sign in to comment.