This repository has been archived by the owner on May 28, 2024. It is now read-only.
Deployment #595
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deployment | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 5 * * *' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: "Build 📦️" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
console: ['switch', 'xboxone', 'ps4'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-python-modules | |
with: | |
path: ~/.cache/pipenv | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/Pipfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}-g | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install dependencies | |
run: | | |
python -m pip install pipenv | |
pipenv install . | |
- name: ${{ matrix.console }} | |
env: | |
CONSOLE: ${{ matrix.console }} | |
run: pipenv run python -m release.cli --output calendars ${CONSOLE} | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.console }} | |
path: calendars | |
deploy: | |
name: "Deploy 🚀" | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: calendars | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: calendars | |
- name: Deploy 🚀 | |
if: success() | |
id: deployment | |
uses: actions/deploy-pages@main |