Skip to content

Commit

Permalink
Update GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
utarwyn committed Oct 25, 2024
1 parent f421b4f commit adc917a
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 60 deletions.
Binary file added .github/pages/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions .github/pages/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!doctype html>
<html lang="fr">
<head>
<meta charset="UTF-8" />
<title>ecoCode : réduisons l'empreinte écologique de nos logiciels</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
name="description"
content="ecoCode est un projet collectif visant à réduire l'impact environnemental des solutions numériques : baisse de la consommation énergétique, inclusivité, accessibilité..."
/>
<!-- Now redirect to green-code-initiative.org -->
<meta
http-equiv="refresh"
content="0; url=https://green-code-initiative.org/"
/>

<link rel="canonical" href="https://green-code-initiative.org" />
<link rel="icon" href="/favicon.png" />
</head>
<body>
<div id="app"></div>
</body>
</html>
60 changes: 0 additions & 60 deletions .github/workflows/build-and-deploy.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy

on:
push:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Use Node.js 20.X
uses: actions/setup-node@v4
with:
node-version: 20.X
cache: npm

- name: Install dependencies
run: npm install

- name: Lint
run: npm run lint

- name: Build
run: npm run build

- name: Replace symlinks by the targeted file
run: find ./dist -type l -exec sh -c 'cp --remove-destination "$(readlink "{}")" "{}"' \;

- uses: actions/upload-artifact@v4
with:
name: website
path: ./dist/

deploy:
runs-on: ubuntu-latest
needs: build

steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: website

- name: Upload to SFTP
uses: wangyucode/[email protected]
with:
host: ${{ secrets.UPLOAD_SFTP_HOST }}
username: ${{ secrets.UPLOAD_SFTP_USERNAME }}
password: ${{ secrets.UPLOAD_SFTP_PASSWORD }}
compress: true
localDir: ${{ github.workspace }}
remoteDir: ${{ secrets.UPLOAD_SFTP_DIRECTORY }}
39 changes: 39 additions & 0 deletions .github/workflows/deploy_github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy GitHub Pages

on:
push:
branches: [main]
paths:
- ".github/pages/**"
- ".github/workflows/**"

jobs:
prepare:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Archive production artifacts
uses: actions/upload-pages-artifact@v3
with:
path: ./.github/pages

deploy:
runs-on: ubuntu-latest
needs: prepare

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit adc917a

Please sign in to comment.