Files
Smith 20169a134d fix: fly.io github actions support for non lowercase owner names
* fly.io app name rules: Name may only contain numbers, lowercase letters and dashes
2023-12-12 17:44:50 +01:00

30 lines
872 B
YAML

name: 🏗 Create cloud app
on:
workflow_dispatch:
jobs:
create:
name: 🛫 Create the app and volume entries
runs-on: ubuntu-latest
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
steps:
- uses: superfly/flyctl-actions/setup-flyctl@master
- name: Set app name
run: |
if [[ -n "${{ secrets.FLY_APP_NAME }}" ]]; then
echo "APP_NAME=${{ secrets.FLY_APP_NAME }}" >> $GITHUB_ENV
else
echo "APP_NAME=${REPO_OWNER,,}-gsw" >> $GITHUB_ENV
fi
env:
REPO_OWNER: '${{ github.repository_owner }}'
- name: 🧱 Create fly.io app
run: flyctl apps create ${{ env.APP_NAME }} --org personal
- name: 💽 Create fly.io volume
run: flyctl volumes create gsw_data --size 1 --region ${{ secrets.FLY_REGION }} --app ${{ env.APP_NAME }} --yes