create workflow

Create main.yml

upload_to_updater

Update upload_to_updater.yml

Update upload_to_updater.yml

Update main.yml

Delete python-app.yml

Delete upload_to_updater.yml

Update main.yml

Update main.yml

Update main.yml

Update main.yml

Update main.yml

Update main.yml
This commit is contained in:
spencershepard 2022-12-29 12:27:37 -08:00
parent f7d43080a0
commit fa02707e23

77
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,77 @@
name: CI
on:
pull_request:
types:
- closed
jobs:
if_merged:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- run: |
echo The PR was merged
deploy:
runs-on: ubuntu-latest # windows-latest | macos-latest
name: Deploy to updater if files changed
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
- name: Get monitored changed files
id: changed-files
uses: tj-actions/changed-files@v35
with:
json: "true"
files_from_source_file: .change-monitored
- name: List all changed files and save to env
run: |
echo "changed_files=${{ steps.changed-files.outputs.all_changed_files }}" >> $GITHUB_ENV
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
- name: Test env vars
run: |
echo "${{env.changed_files}}"
- name: Set up Python 3.10
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
if: steps.changed-files.outputs.any_changed == 'true'
run: |
python -m pip install --upgrade pip
pip install PyYAML
- name: Run release_script.py
if: steps.changed-files.outputs.any_changed == 'true'
env:
FTP_SERVER: ${{ secrets.FTP_SERVER }}
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
run: |
python release_script.py
- name: FTP-Deploy
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/checkout@v2.1.0
with:
fetch-depth: 2
- name: FTP-Deploy-Action
if: steps.changed-files.outputs.any_changed == 'true'
uses: SamKirkland/FTP-Deploy-Action@4.3.3
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
server-dir: Updates/continuous/