Continuous Deployment/Release - Website #460
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Deployment/Release - Website | |
on: | |
workflow_run: | |
workflows: ["Continuous Integration - Website"] | |
types: | |
- completed | |
permissions: write-all | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} && contains(github.event.workflow_run.head_commit.message, '#build-for-review') | |
steps: | |
- name: Info | |
run: echo "Release Workflow - Website" | |
- name: Download files from ci | |
uses: actions/download-artifact@v4 | |
with: | |
run-id: ${{ github.event.workflow_run.id }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
name: propromo.php | |
path: ./propromo.php/** | |
# - name: Create Artifact Directory | |
# run: mkdir -p propromo.php && find . -maxdepth 1 ! -name '.' ! -name 'propromo.php' -exec bash -c 'rm -rf propromo.php/{} && mv {} propromo.php/' \; # move all artifact files to propromo.php directory | |
- name: Zip artifact | |
run: | | |
zip -r propromo-website.zip propromo.php | |
tar -czvf propromo-website.tar.gz propromo.php | |
- name: Generate release tag | |
id: generate_release_tag | |
uses: amitsingh-007/[email protected] | |
with: | |
github_token: ${{ secrets.GH_BOT_TOKEN }} | |
tag_prefix: "v" | |
tag_template: "yyyy.mm.dd.i" | |
- name: Create Release | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GH_BOT_TOKEN }} | |
commit: ${{ github.event.workflow_run.head_sha }} | |
tag: ${{ steps.generate_release_tag.outputs.next_release_tag }} | |
name: Release ${{ github.event.workflow_run.head_sha }} | |
body: Release for commit '${{ github.event.workflow_run.head_commit.message }}' | |
draft: false | |
prerelease: true | |
makeLatest: true | |
files: | | |
propromo-website.zip | |
propromo-website.tar.gz |