Skip to content

Docker build and push #40

Docker build and push

Docker build and push #40

Workflow file for this run

on:
workflow_run:
workflows: ["Lint"]
branches: [main]
types:
- completed
name: Docker build and push
jobs:
build:
name: Docker build and push
if: '!github.event.deleted'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Bump version and push tag
if: github.ref == 'refs/heads/main'
uses: anothrNick/github-tag-action@master
id: version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_BRANCHES: main
WITH_V: false
DEFAULT_BUMP: patch
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to GitHub Container Registry
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
build-args: |
version=${{ steps.version.outputs.new_tag }}
tags: |
ghcr.io/reload/${{ github.repository}}:latest
ghcr.io/reload/${{ github.repository}}:${{ steps.version.outputs.new_tag }}
push: true