Skip to content

Commit

Permalink
fix: fly.io github actions support for non lowercase owner names
Browse files Browse the repository at this point in the history
 * fly.io app name rules: Name may only contain numbers, lowercase letters and dashes
  • Loading branch information
a-sync committed Dec 12, 2023
1 parent 6e0a8e6 commit 20169a1
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 6 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,20 @@ jobs:
- uses: superfly/flyctl-actions/setup-flyctl@master
if: env.SET_ARGS != '' || env.UNSET_ARGS != ''

- 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: 💼 Set secrets on fly.io
if: env.SET_ARGS != ''
run: flyctl secrets set${{ env.SET_ARGS }} --app ${{ github.repository_owner }}-gsw
run: flyctl secrets set${{ env.SET_ARGS }} --app ${{ env.APP_NAME }}

- name: 🗑 Unset secrets on fly.io
if: env.UNSET_ARGS != ''
run: flyctl secrets unset${{ env.UNSET_ARGS }} --app ${{ github.repository_owner }}-gsw
run: flyctl secrets unset${{ env.UNSET_ARGS }} --app ${{ env.APP_NAME }}
14 changes: 12 additions & 2 deletions .github/workflows/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,18 @@ jobs:

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 ${{ github.repository_owner }}-gsw --org personal
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 ${{ github.repository_owner }}-gsw --yes
run: flyctl volumes create gsw_data --size 1 --region ${{ secrets.FLY_REGION }} --app ${{ env.APP_NAME }} --yes
12 changes: 11 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,15 @@ jobs:
fetch-depth: 0

- 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: 🛩 Deploy to fly.io
run: flyctl deploy --remote-only --auto-confirm --region ${{ secrets.FLY_REGION }} --app ${{ github.repository_owner }}-gsw
run: flyctl deploy --remote-only --auto-confirm --region ${{ secrets.FLY_REGION }} --app ${{ env.APP_NAME }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ All other libraries and dependencies are listed in the _package.json file (depen
* https://github.com/msniveau/discord-statusbot
* https://github.com/kevinkjt2000/bowser
* https://github.com/negrifelipe/ServerStatusBot
* https://gitlab.com/lxndr-ab/gswatcher
* https://gitlab.com/lxndr/gswatcher
* https://github.com/Unity-Technologies/qstat
* https://github.com/GiyoMoon/steam-server-query
* https://github.com/Fabricio-191/valve-server-query
Expand Down

0 comments on commit 20169a1

Please sign in to comment.