Skip to content

Commit 8188cb0

Browse files
Danny-SundaresanDanny-Sundaresan
authored andcommitted
Creating a release tag and pushing the changes to git
1 parent 3af1f8f commit 8188cb0

File tree

4 files changed

+82
-1
lines changed

4 files changed

+82
-1
lines changed

.github/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ bundle exec middleman build --clean
2323
## To the internal doc build folder
2424
cd $GITHUB_WORKSPACE
2525
mv /usr/src/app/build $INTERNAL_DOC_BUILD
26+
27+
zip -r $ZIP_DOC_BUILD $EXTERNAL_DOC_BUILD $INTERNAL_DOC_BUILD
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Test Build and Deploy
2+
3+
on:
4+
push:
5+
branches: [ 'feature/changelog' ]
6+
7+
jobs:
8+
test-build-and-deploy:
9+
runs-on: ubuntu-18.04
10+
env:
11+
external-doc-build: external_build
12+
internal-doc-build: internal_build
13+
zip-doc-build: documents.zip
14+
15+
steps:
16+
- name: Accessing github project files
17+
uses: actions/checkout@v2
18+
19+
- name: Build external and internal document
20+
## Use our build docker file
21+
## Which sets up the ruby env to build the slate template
22+
uses: ./
23+
env:
24+
EXTERNAL_DOC_BUILD: ${{ env.external-doc-build }}
25+
INTERNAL_DOC_BUILD: ${{ env.internal-doc-build }}
26+
ZIP_DOC_BUILD: ${{ env.zip-doc-build }}
27+
28+
# - name: Deploy external documentation
29+
# uses: peaceiris/[email protected]
30+
# with:
31+
# github_token: ${{ secrets.GH_TOKEN }}
32+
# publish_dir: ${{ env.external-doc-build }}
33+
# keep_files: false
34+
35+
# - name: Deploy internal documentation
36+
# uses: peaceiris/[email protected]
37+
# with:
38+
# github_token: ${{ secrets.GH_TOKEN }}
39+
# destination_dir: internal
40+
# publish_dir: ${{ env.internal-doc-build }}
41+
# keep_files: false
42+
43+
- name: Get changes from CHANGELOG.md
44+
id: changelog_reader
45+
uses: mindsers/changelog-reader-action@v2
46+
47+
- name: Generate release timestamp
48+
id: tag
49+
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%S')"
50+
51+
- name: Push a tag
52+
id: push_tag
53+
uses: mathieudutour/[email protected]
54+
with:
55+
github_token: ${{ secrets.GH_TOKEN }}
56+
custom_tag: ${{ steps.tag.outputs.date }}
57+
58+
- name: Create Release
59+
id: create_release
60+
uses: actions/[email protected]
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
63+
with:
64+
tag_name: v${{ steps.tag.outputs.date }}
65+
release_name: ${{ steps.tag.outputs.date }}
66+
body: ${{ steps.changelog_reader.outputs.changes }}
67+
prerelease: false
68+
draft: false
69+
70+
- name: Upload Release Asset
71+
uses: actions/[email protected]
72+
env:
73+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
74+
with:
75+
upload_url: ${{ steps.create_release.outputs.upload_url }}
76+
asset_path: ./${{ env.zip-doc-build }}
77+
asset_name: ${{ env.zip-doc-build }}
78+
asset_content_type: application/zip

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## Unreleased
88
### Added
99
* Added a changelog enforcer to the workflow.
10+
* Tagging and uploading the releases.
1011

1112
## Documentation Update <sub><sup>(February 16, 2021)</sup></sub>
1213
### Changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ COPY .github/build.sh /usr/src/bin/
66

77
RUN gem install bundler
88

9-
RUN apk --no-cache --update add nodejs g++ make coreutils git && \
9+
RUN apk --no-cache --update add nodejs g++ make coreutils git zip && \
1010
git clone https://github.com/slatedocs/slate.git /usr/src/app && \
1111
bundle install && \
1212
chmod +x /usr/src/bin/*.sh

0 commit comments

Comments
 (0)