refactor: made action more redable
All checks were successful
Gitea Actions Demo / Build (push) Successful in 1m15s
All checks were successful
Gitea Actions Demo / Build (push) Successful in 1m15s
This commit is contained in:
41
.gitea/workflows/build.yaml
Normal file
41
.gitea/workflows/build.yaml
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
|
||||
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: 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 ${{ github.workspace }}/../private.key -P ${{ secrets.BLOG_PORT }} build blog@madeio.net:/var/www/html/
|
||||
ssh -i ${{ github.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/
|
||||
Reference in New Issue
Block a user