Skip to content

Commit

Permalink
added way to pick which target to deploy to and merge workflow files …
Browse files Browse the repository at this point in the history
…to 1
  • Loading branch information
rmrt1n committed Oct 15, 2021
1 parent d2b9444 commit 2935f6c
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 48 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Deploy Site

on:
push:
branches: [ master ]
workflow_dispatch:

jobs:
set-deploy-type:
runs-on: ubuntu-latest
env:
VALID_TARGETS: ['gh-pages', 'firebase']
steps:
- uses: actions/checkout@v2

- name: get deployment target
run: TARGET=$(cat DEPLOY_STRATEGY)

- name: check if target is valid
if: !contains($VALID_TARGETS, $TARGET)
run: |
echo 'Invalid Deployment Target'
exit 1
deploy-gh-pages:
runs-on: ubuntu-latest
if: $TARGET == 'gh-pages'
steps:
- uses: actions/checkout@v2

- name: Deploy Jekyll Site
uses: sujaykundu777/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}

deploy-firebase:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- 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 }}
29 changes: 0 additions & 29 deletions .github/workflows/firebase.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/main.yml

This file was deleted.

1 change: 1 addition & 0 deletions DEPLOY_STRATEGY
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gh-pages

0 comments on commit 2935f6c

Please sign in to comment.