Docker Releaser Workflow #28
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: Docker Releaser Workflow | |
on: | |
workflow_dispatch: | |
inputs: | |
release_version: | |
type: string | |
description: release version when building docker containers (example; 2.0.0) | |
jobs: | |
build_aws_connector_docker_image: | |
name: Release docker images | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login to Github Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout code | |
uses: actions/checkout@master | |
- name: Build Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
build-args: | | |
BASE_IMAGE=alpine:3.14 | |
tags: | | |
ghcr.io/lamassuiot/lamassu-ui:${{ github.event.inputs.release_version }} | |
ghcr.io/lamassuiot/lamassu-ui:latest | |
push: true | |
- name: Create tag | |
uses: actions/github-script@v5 | |
with: | |
script: | | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: 'refs/tags/${{ github.event.inputs.release_version }}', | |
sha: context.sha | |
}) | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ github.event.inputs.release_version }} | |
release_name: Release v${{ github.event.inputs.release_version }} | |
body: | | |
Changes in this Release | |
- First Change | |
- Second Change | |
draft: false | |
prerelease: false |