Skip to content

Commit

Permalink
add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
zlayine committed Mar 25, 2024
1 parent 49bc253 commit 3c14815
Showing 1 changed file with 42 additions and 9 deletions.
51 changes: 42 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Build App
on:
pull_request:
paths-ignore:
- '**.md'
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
push:
paths-ignore:
- '**.md'

jobs:
build:
Expand All @@ -21,11 +21,44 @@ jobs:
run: npm install
- name: Copy config.json
run: |
cp ./resources/js/config.json.example ./resources/js/config.json
- name: Build static project
cp ./resources/js/config.json.example ./resources/js/config.json
- name: Build project
run: npm run prod-laravel
- name: Archive build artifacts
uses: actions/upload-artifact@v2
with:
name: build
path: dist
path: public
release:
if: github.ref == 'refs/heads/master'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download build artifact
uses: actions/download-artifact@v2
with:
name: build
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Release of ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Release Artifact
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./public/build
asset_name: build.zip
asset_content_type: application/zip

0 comments on commit 3c14815

Please sign in to comment.