diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml new file mode 100644 index 0000000..4899364 --- /dev/null +++ b/.github/workflows/publish-release.yml @@ -0,0 +1,18 @@ +name: Publish release + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Publish release + uses: docker://antonyurchenko/git-release:latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ALLOW_EMPTY_CHANGELOG: "true" diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dc6967..8633ada 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org). +## [1.0.1] - 2021-08-29 +### Added +* *Nothing* + +### Changed +* *Nothing* + +### Deprecated +* *Nothing* + +### Removed +* *Nothing* + +### Fixed +* Replaced slug by branch name when generating sub-folder, as the slug is impossible to infer when consuming this action + + ## [1.0.0] - 2021-08-29 ### Added * First release diff --git a/README.md b/README.md index fbb8680..d341863 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,8 @@ A GitHub action to deploy preview environments for static apps using GitHub Page This action expects you to checkout and build your static assets. After that, it will run next steps: -* Generate a unique slug from the branch name plus current date. For example, if your branch is `Update-landing-page`, it will generate a slug like `2021-05-08-update-landing-page`. * Publish the contents from the folder of your choice into a branch where you should have configured GitHub Pages to be served. -* Use the slug generated in first step to create a sub-folder with your contents. That way, if your repository is `my-org/my-repo`, you will be able to access the preview env in https://my-org.github.io/my-repo/2021-05-08-update-landing-page +* Use the branch name to create a sub-folder with your contents. That way, if your repository is `my-org/my-repo`, you will be able to access the preview env in https://my-org.github.io/my-repo/main * If you run this action during `pull_request` or `pull_request_target` events: publish a comment after the preview env is ready, with the URL from previous step. ## Usage @@ -31,7 +30,7 @@ jobs: npm run build - name: Deploy - uses: shlinkio/deploy-preview-action@v1 + uses: shlinkio/deploy-preview-action@v1.0.1 with: branch: gh-pages # The branch from where the GitHub Pages are served (defaults to preview-env) folder: build # The folder where the artifacts to publish are (defaults to the project root) diff --git a/action.yml b/action.yml index b3e8e41..d7ef54d 100644 --- a/action.yml +++ b/action.yml @@ -16,7 +16,7 @@ runs: steps: - name: Generate slug id: generate_slug - run: echo "##[set-output name=slug;]$(echo ${GITHUB_HEAD_REF#refs/heads/} | sed -r 's/[~\^]+//g' | sed -r 's/[^a-zA-Z0-9]+/-/g' | sed -r 's/^-+\|-+$//g' | tr A-Z a-z)" + run: echo "##[set-output name=slug;]$(echo ${GITHUB_HEAD_REF#refs/heads/})" shell: bash - name: Determine base URL id: determine_base_url