Skip to content

Commit 48037a2

Browse files
committed
Fixed slug generation
1 parent 58c5b3d commit 48037a2

File tree

4 files changed

+38
-4
lines changed

4 files changed

+38
-4
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Publish release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
- name: Publish release
15+
uses: docker://antonyurchenko/git-release:latest
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
ALLOW_EMPTY_CHANGELOG: "true"

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file.
44

55
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).
66

7+
## [1.0.1] - 2021-08-29
8+
### Added
9+
* *Nothing*
10+
11+
### Changed
12+
* *Nothing*
13+
14+
### Deprecated
15+
* *Nothing*
16+
17+
### Removed
18+
* *Nothing*
19+
20+
### Fixed
21+
* Replaced slug by branch name when generating sub-folder, as the slug is impossible to infer when consuming this action
22+
23+
724
## [1.0.0] - 2021-08-29
825
### Added
926
* First release

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ A GitHub action to deploy preview environments for static apps using GitHub Page
66

77
This action expects you to checkout and build your static assets. After that, it will run next steps:
88

9-
* 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`.
109
* Publish the contents from the folder of your choice into a branch where you should have configured GitHub Pages to be served.
11-
* 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
10+
* 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
1211
* 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.
1312

1413
## Usage
@@ -31,7 +30,7 @@ jobs:
3130
npm run build
3231
3332
- name: Deploy
34-
uses: shlinkio/deploy-preview-action@v1
33+
uses: shlinkio/deploy-preview-action@v1.0.1
3534
with:
3635
branch: gh-pages # The branch from where the GitHub Pages are served (defaults to preview-env)
3736
folder: build # The folder where the artifacts to publish are (defaults to the project root)

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ runs:
1616
steps:
1717
- name: Generate slug
1818
id: generate_slug
19-
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)"
19+
run: echo "##[set-output name=slug;]$(echo ${GITHUB_HEAD_REF#refs/heads/})"
2020
shell: bash
2121
- name: Determine base URL
2222
id: determine_base_url

0 commit comments

Comments
 (0)