Skip to content

Commit

Permalink
Merge pull request #143 from amitsingh-007/f-setup-surge-webpack-gh-a…
Browse files Browse the repository at this point in the history
…ctions
  • Loading branch information
amitsingh-007 authored Dec 9, 2020
2 parents 1db6363 + 9ef6105 commit 57ee17b
Show file tree
Hide file tree
Showing 5 changed files with 635 additions and 570 deletions.
45 changes: 36 additions & 9 deletions .github/workflows/deploy.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Github Action
name: CI
on: push

jobs:
Deploy:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo 🛎️
Expand All @@ -27,24 +27,40 @@ jobs:
- name: Building 🛠
run: npm run release

# ----------Below steps are for release process(only executes for master)--------------
- name: Upload artfacts 🎨
if: ${{ github.ref == 'refs/heads/master' }}
uses: actions/upload-artifact@v2
with:
name: build
path: ./build/

Release:
runs-on: ubuntu-latest
needs: [Build]
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- name: Checkout repo 🛎️
uses: actions/checkout@v2

- name: Download artifacts 🎨
uses: actions/download-artifact@v2
with:
name: build
path: ./build/

- name: Generate Release Tag 🏷
if: ${{ github.ref == 'refs/heads/master' }}
uses: amitsingh-007/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Generate changelog 🧾
if: ${{ github.ref == 'refs/heads/master' }}
id: changelog
uses: metcalfc/[email protected]
with:
myToken: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release ✒
id: create_release
if: ${{ github.ref == 'refs/heads/master' }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -56,14 +72,12 @@ jobs:
prerelease: false

- name: Get Release Asset Name 🗃
if: ${{ github.ref == 'refs/heads/master' }}
id: get_release_asset_name
run: |
file=$(find ./build/bypass-links-*.zip -printf "%f\n")
echo "::set-output name=asset_name::$file"
- name: Upload Release Asset ☁
if: ${{ github.ref == 'refs/heads/master' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -73,8 +87,21 @@ jobs:
asset_name: ${{ steps.get_release_asset_name.outputs.asset_name }}
asset_content_type: application/zip

Deploy:
runs-on: ubuntu-latest
needs: [Release]
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- name: Download artifacts 🎨
uses: actions/download-artifact@v2
with:
name: build
path: ./build/

- name: Deploying to surge.sh 🐙
run: npx surge -- --token ${{ secrets.SURGE_TOKEN }}

- name: Deploying to gh-pages 🚀
if: ${{ github.ref == 'refs/heads/master' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/compress.yml

This file was deleted.

Loading

0 comments on commit 57ee17b

Please sign in to comment.