Skip to content

Commit

Permalink
Update GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
phuonghuynh committed Aug 11, 2021
1 parent 911d961 commit 83bdecc
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 16 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/manual-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: manual-release

on:
workflow_dispatch:
inputs:
tag_name:
required: true
description: tag name for the release

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{github.event.inputs.tag_name}}

jobs:
make-release:
runs-on: ubuntu-latest
steps:
- name: clone it
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 50

- name: setup env vars
run: |
REPOSITORY_NAME="${{github.repository}}"
echo "REPOSITORY_NAME=$REPOSITORY_NAME" >> ${GITHUB_ENV}
- name: make new release
uses: softprops/[email protected]
with:
token: ${{ env.GITHUB_TOKEN }}
tag_name: ${{env.TAG_NAME}}
body: "#release-by-ci for v${{env.TAG_NAME}}"
draft: false
prerelease: false
28 changes: 28 additions & 0 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: on-release

on:
release:
types: [ published ]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
build-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 50

- uses: olegtarasov/get-tag@v2

- uses: elgohr/Publish-Docker-Github-Action@master
with:
dockerfile: Dockerfile
tags: "latest,${{env.GIT_TAG_NAME}}"
registry: docker.pkg.github.com
name: ${{env.REPOSITORY_NAME}}/webapp-aws
username: ${{github.actor}}
password: ${{env.GITHUB_TOKEN}}
17 changes: 1 addition & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,4 @@ jobs:
publish-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 50
- run: echo ::set-env name=REPOSITORY_NAME::$(echo ${{github.repository}} | awk '{print tolower($0)}')
name: set env.REPOSITORY_NAME
- uses: olegtarasov/get-tag@v2
id: tagName
- uses: elgohr/Publish-Docker-Github-Action@master
with:
dockerfile: Dockerfile
tags: "latest,${{env.GIT_TAG_NAME}}"
registry: docker.pkg.github.com
name: ${{env.REPOSITORY_NAME}}/webapp-aws
username: ${{github.actor}}
password: ${{github.token}}
- run: echo "no thing to run"

0 comments on commit 83bdecc

Please sign in to comment.