build-n-push #1
Workflow file for this run
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-n-push | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io/geekopsua | |
IMAGE_NAME: ${{ github.repository }} | |
defaults: | |
run: | |
shell: bash | |
working-directory: ./ | |
jobs: | |
build: | |
name: Build and push Docker image | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Conventional Changelog Action | |
uses: TriPSs/conventional-changelog-action@v3 | |
with: | |
github-token: ${{ secrets.github_token }} | |
# https://github.com/marketplace/actions/docker-login | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
# Build and push Docker image | |
- name: Setup go-task | |
uses: pnorton5432/setup-task@v1 | |
with: | |
task-version: 3.29.1 | |
- name: Build Docker image | |
run: | | |
ls -lha . && pwd | |
echo "Build the image" | |
task build-docker Tag="${{ github.ref_name }}" | |
- name: Push Docker image | |
run: | | |
echo "Push the image" | |
task push-docker Tag="${{ github.ref_name }}" |