Skip to content

Commit

Permalink
Create docker-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
datajohnson committed May 22, 2024
1 parent e86f774 commit 31d64e2
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Push

on:
push:
branches: [main, test]

env:
REGISTRY: ghcr.io

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Generate release tag
id: generate_release_tag
uses: amitsingh-007/next-release-tag@v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_prefix: "v"
tag_template: "yyyy.mm.dd.i"

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:${{ steps.generate_release_tag.outputs.next_release_tag }}

- name: Create release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.generate_release_tag.outputs.next_release_tag }}

0 comments on commit 31d64e2

Please sign in to comment.