Skip to content

Update 2024-05-15-resolve-azure-maintenance-configuration-error.markdown #1197

Update 2024-05-15-resolve-azure-maintenance-configuration-error.markdown

Update 2024-05-15-resolve-azure-maintenance-configuration-error.markdown #1197

Workflow file for this run

name: Deploy Site
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
set-deploy-type:
runs-on: ubuntu-latest
outputs:
target: ${{ steps.set-output.outputs.target }}
steps:
- uses: actions/checkout@v4
- name: get deployment target
run: |
TARGET=$(cat DEPLOY_STRATEGY)
echo "TARGET=$TARGET" >> $GITHUB_ENV
- name: check if target is valid
if: success() && !contains(fromJSON('["gh-pages", "firebase", "none"]'), env.TARGET)
run: echo 'Invalid Deployment Target' && exit 1
# gh actions doesn't support using the 'env' context on job level ifs for
# some reason smh. here we use outputs instead
- name: set output to deploy target
id: set-output
run: echo "::set-output name=target::${{ env.TARGET }}"
# not sure if anyone wants this but I'm putting this here for those that don't
# want to host their site. else the actions will show an annoying x whenever
# you push to master
deploy-none:
runs-on: ubuntu-latest
needs: set-deploy-type
if: needs.set-deploy-type.outputs.target == 'none'
steps:
- run: echo 'No Deployment Specified' && exit 0
deploy-gh-pages:
runs-on: ubuntu-latest
needs: set-deploy-type
if: needs.set-deploy-type.outputs.target == 'gh-pages'
steps:
- uses: actions/checkout@v4
- name: Deploy Jekyll Site
uses: x-limitless-x/jekyll-deploy-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
deploy-firebase:
runs-on: ubuntu-latest
needs: set-deploy-type
if: needs.set-deploy-type.outputs.target == 'firebase'
steps:
- uses: actions/checkout@v4
- name: setup ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: build jekyll
run: |
bundle install
bundle exec jekyll build
- name: deploy to firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only hosting
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}