From b42be6b0ed30a96d7470dc0e8be239747a38b0b1 Mon Sep 17 00:00:00 2001 From: Tommy Leung Date: Sun, 17 May 2020 13:04:08 -0600 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 39 +++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9b97e5d..f79ded5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,8 @@ name: CI -on: [push] +on: + push: + branches: master jobs: build: @@ -12,6 +14,11 @@ jobs: uses: actions/checkout@master with: lfs: true + - name: Create zip + uses: thedoctor0/zip-release@master + with: + filename: SourceWithAssets.zip + exclusions: '*.git*' - name: Install Parcel run: npm install parcel-bundler @@ -29,3 +36,33 @@ jobs: BRANCH: gh-pages # The branch the action should deploy to. FOLDER: dist CLEAN: true + + - name: Delete Previous latest Release + uses: author/action-rollback@stable + with: + # Using a tag name + tag: 'latest' + env: + GITHUB_TOKEN: ${{ secrets.GHP_TOKEN }} + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GHP_TOKEN }} + with: + tag_name: 'latest' + release_name: 'latest' + draft: false + prerelease: false + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GHP_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./SourceWithAssets.zip + asset_name: SourceWithAssets.zip + asset_content_type: application/zip