Skip to content

Commit

Permalink
Add actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mijailr committed Aug 6, 2020
1 parent 84038e4 commit e07af97
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: release
on:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v1

- name: Get deps cache
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gems-

- uses: actions/setup-ruby@v1
with:
ruby-version: "2.6"

- name: Bundle install
run: |
gem install bundler:2.1.4
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Build docset
run: |
bundle exec cheatset generate terraform.rb
zip terraform-docset.zip Terraform.docset
- uses: actions/upload-artifact@v2
with:
name: terraform-docset
path: terraform-docset.zip

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: terraform-docset
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./terraform-docset.zip
asset_name: terraform-docset.zip
asset_content_type: application/zip

0 comments on commit e07af97

Please sign in to comment.