Compare commits
23 Commits
dev
...
23a7243b58
| Author | SHA1 | Date | |
|---|---|---|---|
| 23a7243b58 | |||
| c11c49f0e2 | |||
| 92c598727a | |||
| a581d96eef | |||
| 716a9e6470 | |||
| 7b695d94f7 | |||
| 1ddff719cb | |||
| 6ba4541d87 | |||
| a08dfcf4c1 | |||
| f1fc074f1f | |||
| 77adf10d54 | |||
| 28987cdb2e | |||
| 1ea76ef718 | |||
| b490042c20 | |||
| 213d2a579f | |||
| 4d4bf30046 | |||
| 5714a40b25 | |||
| 36ebb57c97 | |||
| 3f2fb7cca2 | |||
| a360a0fafe | |||
| d95aa9d12c | |||
| 41966da44e | |||
| daa2e6a426 |
61
.gitea/workflows/build.yaml
Normal file
61
.gitea/workflows/build.yaml
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
|
||||||
|
|
||||||
|
name: Gitea Actions Demo
|
||||||
|
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
- name: Setup Node v20
|
||||||
|
uses: actions/setup-node@v5
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
cd ${{ gitea.workspace }}
|
||||||
|
npm ci
|
||||||
|
- name: Build
|
||||||
|
run: npm run build
|
||||||
|
- name: Save Build Artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: build-artifact
|
||||||
|
path: ${{ gitea.workspace }}/build/*
|
||||||
|
include-hidden-files: true
|
||||||
|
|
||||||
|
Upload:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: Build
|
||||||
|
steps:
|
||||||
|
- name: Download artifact
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: build-artifact
|
||||||
|
path: ${{ gitea.workspace }}/build
|
||||||
|
- name: setup ssh
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh/
|
||||||
|
echo "$SSH_PRIVATE_KEY" > ../private.key
|
||||||
|
sudo chmod 600 ../private.key
|
||||||
|
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
SSH_PRIVATE_KEY: ${{secrets.SSH_KEY}}
|
||||||
|
SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}}
|
||||||
|
- name: upload to web
|
||||||
|
run: |
|
||||||
|
scp -r -i ${{ gitea.workspace }}/../private.key -P ${{ secrets.BLOG_PORT }} build blog@madeio.net:/var/www/html/
|
||||||
|
ssh -i ${{ gitea.workspace }}/../private.key -p ${{ secrets.BLOG_PORT }} blog@madeio.net "$PERM_COPY"
|
||||||
|
env:
|
||||||
|
PERM_COPY: chmod -R 775 /var/www/html/build; cp -r /var/www/html/build/* /var/www/html/; rm -r /var/www/html/build
|
||||||
|
- name: cleanup ssh
|
||||||
|
run: |
|
||||||
|
rm ${{ gitea.workspace }}/../private.key
|
||||||
|
rm ~/.ssh/known_hosts
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
name: Gitea Actions Demo
|
|
||||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
Build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
|
||||||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
|
||||||
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
|
||||||
- name: Check out repository code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- run: |
|
|
||||||
cd ${{ gitea.workspace }}
|
|
||||||
- run: npm i
|
|
||||||
- run: npm run build
|
|
||||||
- run: ls build
|
|
||||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
|
||||||
Reference in New Issue
Block a user