Skip to content

szegeder.hu (#335) #106

szegeder.hu (#335)

szegeder.hu (#335) #106

name: Automatic deploy
on:
push:
branches:
- master
paths:
- LICENSE
- RELEASE_README.md
- sections/**.txt
- sections/headers/**.txt
- filters.json
- assets/scripts/*.js
- .gitattributes
workflow_dispatch:
jobs:
build:
if: github.repository == 'hufilter/hufilter-dev'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master
- uses: actions/setup-node@v3
with:
node-version: latest
- name: Install dependencies
run: npm install
- name: Create release directory
run: |
mkdir release
cp LICENSE ./release/LICENSE
cp RELEASE_README.md ./release/README.md
cp .gitattributes ./release/.gitattributes
- name: Run build script
run: npm run build
- name: Create artifact
uses: actions/upload-artifact@v3
with:
name: release_artifact
path: release/**
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: release_artifact
path: ./release
- name: Commit and push changes
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: release
destination-repository-username: hufilter
destination-repository-name: hufilter
user-email: [email protected]
user-name: hufilterbot
target-branch: master
commit-message: Automatic deploy from ORIGIN_COMMIT