Skip to content

Commit

Permalink
I1542 Making changes to build manually, trigging the build for creati…
Browse files Browse the repository at this point in the history
…ng the draft release (#1549)

* Making changes to build manually. Manually trigging the Build and creating the draft release
  • Loading branch information
pushyamig authored Jan 22, 2024
1 parent 582908d commit 7c2ac2d
Showing 1 changed file with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
name: Docker image CI
name: MyLA Build/Release

on:
push:
# takes muliple branch names
branches:
- master
- '[0-9][0-9][0-9][0-9].[0-9][0-9].*' # 2021.01.01

- '[0-9][0-9][0-9][0-9].[0-9][0-9].*' # 2021.01.x
tags:
- '[0-9][0-9][0-9][0-9].[0-9][0-9].[0-9][0-9]' # 2021.01.01

workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
default: 'YYYY.MINOR.MICRO'
env:
IMAGE_TAG: latest
REPO_URL: ${{ github.repository }}

jobs:
Expand All @@ -27,7 +34,7 @@ jobs:

- name: build Docker image
run: |
docker build . --tag ghcr.io/${{ env.REPO_URL }}:${{ env.IMAGE_TAG }}-${BRANCH_NAME}
docker build . --tag ghcr.io/${{ env.REPO_URL }}:${BRANCH_NAME}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand All @@ -38,5 +45,23 @@ jobs:

- name: Push Docker image to GitHub Container Registry
run: |
docker push ghcr.io/${{ env.REPO_URL }}:${{ env.IMAGE_TAG }}-${BRANCH_NAME}
docker push ghcr.io/${{ env.REPO_URL }}:${BRANCH_NAME}
release:
# Making sure that release only runs for tag pushes
if: startsWith(github.ref, 'refs/tags/') && github.repository_owner == 'tl-its-umich-edu'
needs: build # This ensures the build job finishes successfully before starting this job
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Draft Release
id: create_release
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


0 comments on commit 7c2ac2d

Please sign in to comment.