create release #5
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: Part 1 - Release Package | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'Part 1 - Storage/docker-compose.yml' | |
- 'Part 1 - Storage/example.env' | |
- 'Part 1 - Storage/init.sql' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Create Release Package | |
run: | | |
mkdir release | |
cp Part\ 1\ -\ Storage/example.env release/ | |
cp Part\ 1\ -\ Storage/init.sql release/ | |
cp Part\ 1\ -\ Storage/docker-compose.yml release/ | |
cd release | |
zip -r Part-one-storage.zip . | |
- name: Upload Release Package | |
uses: actions/upload-artifact@v2 | |
with: | |
name: release-package-part1 | |
path: release/Part-one-storage.zip | |
# Generate a random tag name and output it | |
- name: Generate random tag name | |
id: random_tag | |
run: echo "RANDOM_TAG=$(date +%Y%m%d%H%M%S)-${GITHUB_RUN_ID}" >> $GITHUB_ENV | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
# GITHUB_TOKEN needed to allow read and write access | |
# Setting --> Actions --> General --> Workflow permissions: Read and write permissions | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.RANDOM_TAG }} | |
release_name: Part one storage release for ${{ env.RANDOM_TAG }} | |
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: ./release/Part-one-storage.zip | |
asset_name: Part-one-storage.zip | |
asset_content_type: application/zip |