Rewritten github actions script to gitea actions
This commit is contained in:
@ -2,6 +2,8 @@ name: Deploy
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
@ -14,46 +16,37 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
with:
|
||||||
version: 8
|
version: 8
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install
|
run: pnpm install
|
||||||
|
|
||||||
- name: Build project
|
- name: Build project
|
||||||
run: pnpm build
|
run: pnpm build
|
||||||
|
|
||||||
- name: Upload production-ready build files
|
- name: Upload production-ready build files
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: production-files
|
name: dist
|
||||||
path: ./dist
|
path: ./dist
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
name: Deploy
|
name: Deploy
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: host
|
||||||
if: github.ref == 'refs/heads/master'
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifact
|
- name: Download artifact
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: production-files
|
name: dist
|
||||||
path: ./dist
|
path: ./dist
|
||||||
|
|
||||||
# Deploy to local repo
|
# Deploy to local repo
|
||||||
- name: Deploy
|
- name: Move files to server
|
||||||
uses: s0/git-publish-subdir-action@develop
|
run: |
|
||||||
env:
|
rm -rf /var/www/martials.no/*
|
||||||
REPO: self
|
cp -r dist/* /var/www/martials.no
|
||||||
BRANCH: build
|
|
||||||
FOLDER: dist
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
Reference in New Issue
Block a user