Skip to content

Commit

Permalink
Added release action within deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dharmesh-hemaram committed Aug 26, 2024
1 parent 0d6161b commit 9ea546a
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ on:
version:
description: 'Version (v4.0.0.0)'
type: string
required: false

jobs:
main:
name: Build & Bundle
environment:
name: ${{inputs.environment}}
url: ${{ steps.artifact-upload-step.outputs.artifact-url }}
url: ${{ steps.release.outputs.url || steps.artifact-upload-step.outputs.artifact-url}}
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
actions: read
discussions: write
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -82,13 +82,25 @@ jobs:
- name: Bundle Projects
run: |
mkdir bundle
cd dist/apps
zip -r ../../bundle/acf-i18n.zip acf-i18n/
cd dist/apps/acf-i18n
zip -r ../../../bundle/acf-i18n-${{vars.NX_PUBLIC_VARIANT}}.zip .
cd ..
cd acf-options-page
zip -r ../../../bundle/acf-options-page.zip .
zip -r ../../../bundle/acf-options-page-${{vars.NX_PUBLIC_VARIANT}}.zip .
cd ..
cd acf-extension
zip -r ../../../bundle/acf-extension.zip .
zip -r ../../../bundle/acf-extension-${{vars.NX_PUBLIC_VARIANT}}.zip .
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
id: release
with:
token: ${{ secrets.REPO_PAT }} # Use the PAT here
prerelease: ${{ vars.NX_VARIANT == 'BETA' || vars.NX_VARIANT == 'DEV'}}
repository: Dhruv-Techapps/acf-docs
generate_release_notes: true
discussion_category_name: 'Release'
fail_on_unmatched_files: true
- uses: actions/upload-artifact@v4
id: artifact-upload-step
with:
Expand All @@ -111,7 +123,7 @@ jobs:
uses: mnao305/chrome-extension-upload@v5.0.0
id: chrome-extension-upload
with:
file-path: acf-extension.zip
file-path: acf-extension-${{vars.NX_PUBLIC_VARIANT}}.zip
extension-id: ${{ vars.NX_PUBLIC_CHROME_EXTENSION_ID }}
client-id: ${{ secrets.CLIENT_ID }}
client-secret: ${{ secrets.CLIENT_SECRET }}
Expand All @@ -135,7 +147,7 @@ jobs:
with:
name: nx-main-artifacts
- name: unzip
run: unzip acf-options-page.zip -d acf-options-page
run: unzip acf-options-page-${{vars.NX_PUBLIC_VARIANT}}.zip -d acf-options-page
- name: Build And Deploy
id: deploy
uses: Azure/static-web-apps-deploy@v1
Expand Down

0 comments on commit 9ea546a

Please sign in to comment.