From 745bb0d9859e0fe988f982457a42020f2b975f98 Mon Sep 17 00:00:00 2001 From: Jeremy Cook Date: Wed, 6 Sep 2023 10:31:13 +1200 Subject: [PATCH] updated build and release --- .github/workflows/release.yml | 50 +++++++++++++++++++---------------- README.md | 3 +++ 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 18a6a3e..0ba94ae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,36 +1,40 @@ -# This is a basic workflow to help you get started with Actions +name: Build -name: CI - -# Controls when the workflow will run on: - # Triggers the workflow on push or pull request events but only for the "main" branch push: - branches: [ "main" ] + tags: + - '*.*.*' pull_request: - branches: [ "main" ] - - # Allows you to run this workflow manually from the Actions tab + branches: + - main workflow_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" build: - # The type of runner that the job will run on runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo Hello, world! + - uses: actions/checkout@v2 - # Runs a set of commands using the runners shell - - name: Run a multi-line script + - name: Set env + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Package run: | - echo Add other actions to build, - echo test, and deploy your project. + echo packaging... + tar -czf release-${{ env.RELEASE_VERSION }}.tar.gz terraform + + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: release-${{ env.RELEASE_VERSION }} + path: release-${{ env.RELEASE_VERSION }}.tar.gz + + - name: Make Release + uses: softprops/action-gh-release@v0.1.5 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + release-${{ env.RELEASE_VERSION }}.tar.gz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md index 5512902..cbd37ab 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +![Build Status](https://github.com/cloudacademy/stocks-app-eks/actions/workflows/release.yml/badge.svg) +![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/cloudacademy/stocks-app-eks) + ## EKS Cluster and Stocks Cloud Native App Deployment The following instructions are provided to demonstrate how to provision a new EKS cluster and automatically deploy a fully functional Stocks cloud native web application.