Merge pull request #324 from icefoganalytics/test #311
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 and Push | |
on: | |
push: | |
branches: [main, test] | |
# Publish semver tags as releases. | |
tags: ["v*.*.*", "v*.*.*.*"] | |
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/[email protected] | |
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 }} |