Skip to content

Commit

Permalink
add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
brycedorn committed Feb 18, 2023
1 parent df0a11a commit cc855c5
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/batch-process.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Batch process year
on:
workflow_dispatch:
inputs:
year:
description: 'Year'
required: true
env:
GH_AUTH_TOKEN: ${{ secrets.GH_AUTH_TOKEN }}
jobs:
batch-process-year:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Install Rust 🦀
uses: dtolnay/rust-toolchain@v1
with:
components: rustfmt, clippy
toolchain: stable

- name: Lint 🧹
run: |
cargo fmt --all -- --check
cargo clippy -- -D warnings
- name: Test 🔨
run: cargo test

- name: Run 🤖
run: cargo run -- batch ${{ github.event.inputs.year }}
17 changes: 17 additions & 0 deletions .github/workflows/deploy-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Fly Deploy
on:
push:
branches:
- main
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: |
cd cache
flyctl deploy --remote-only
45 changes: 45 additions & 0 deletions .github/workflows/deploy-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy site
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Install ⚙️
run: |
cd web
npm install
- name: Build 🛠
run: |
cd web
npm run build
- name: Upload Artifacts 🔺
uses: actions/upload-artifact@v1
with:
name: site
path: web/dist

deploy:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Download Artifacts 🔻
uses: actions/download-artifact@v1
with:
name: site

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: deploy
folder: "site"
35 changes: 35 additions & 0 deletions .github/workflows/hide-apod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Hide days from results
on:
workflow_dispatch:
inputs:
date:
description: 'Dates (comma-separated YYYY-MM-DD)'
required: true
env:
SUPABASE_REST_URL: ${{ secrets.SUPABASE_REST_URL }}
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_PUBLIC_API_KEY: ${{ secrets.SUPABASE_PUBLIC_API_KEY }}
GH_AUTH_TOKEN: ${{ secrets.GH_AUTH_TOKEN }}
jobs:
hide-from-results:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Install Rust 🦀
uses: dtolnay/rust-toolchain@v1
with:
components: rustfmt, clippy
toolchain: stable

- name: Lint 🧹
run: |
cargo fmt --all -- --check
cargo clippy -- -D warnings
- name: Test 🔨
run: cargo test

- name: Run 🤖
run: cargo run -- exclude ${{ github.event.inputs.date }}
39 changes: 39 additions & 0 deletions .github/workflows/process.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Process images for month
on:
workflow_dispatch:
inputs:
year:
description: 'Year'
required: true
month:
description: 'Month'
required: true
env:
SUPABASE_REST_URL: ${{ secrets.SUPABASE_REST_URL }}
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_PUBLIC_API_KEY: ${{ secrets.SUPABASE_PUBLIC_API_KEY }}
APOD_API_URL: ${{ secrets.APOD_API_URL }}
APOD_API_KEY: ${{ secrets.APOD_API_KEY }}
jobs:
process-images-for-month:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Install Rust 🦀
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
toolchain: stable

- name: Lint 🧹
run: |
cargo fmt --all -- --check
cargo clippy -- -D warnings
- name: Test 🔨
run: cargo test

- name: Run 🤖
run: cargo run -- ${{ github.event.inputs.year }} ${{ github.event.inputs.month }}

0 comments on commit cc855c5

Please sign in to comment.