Build and deploy from branch. #48
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: Build, push and update | |
on: | |
workflow_dispatch: | |
inputs: | |
skip-unit-test: | |
type: boolean | |
required: true | |
description: Skip unit-test | |
jobs: | |
build_push_update: | |
runs-on: ubuntu-latest | |
environment: dev-cd | |
permissions: | |
id-token: write | |
packages: write | |
contents: write | |
steps: | |
# | |
# Checkout the source code. | |
# | |
- name: Checkout the source code | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | |
with: | |
token: ${{ secrets.GIT_PAT }} | |
fetch-depth: 0 | |
# | |
# RELEASE CANDIDATE - Build Docker image. | |
# | |
- name: RELEASE CANDIDATE - Build Docker image | |
run: | | |
docker build \ | |
--no-cache --progress=plain \ | |
--secret id=gh_user,env=${{ secrets.GIT_USER }} \ | |
--secret id=gh_token,env=${{ secrets.GIT_PAT }} \ | |
-f src/main/docker/Dockerfile.multistage \ | |
-t ghcr.io/${{ github.repository }}:${{ github.head_ref || github.ref_name }} \ | |
. | |
# | |
# RELEASE CANDIDATE - Push Docker image. | |
# | |
- name: RELEASE CANDIDATE - Push Docker image | |
run: | | |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
docker push -a ghcr.io/${{ github.repository }} | |
# |