Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions .github/workflows/dockerfile-validation.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Dockerfile Validation
name: Docker Build and Publish

on:
push:
Expand All @@ -13,28 +13,39 @@ on:
- '.github/workflows/dockerfile-validation.yml'

jobs:
validate-dockerfile:
docker:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Lint Dockerfile
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: Dockerfile
failure-threshold: warning

- name: Build Docker image

- name: Log in to GitHub Container Registry
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Docker image (PR) / Build and push image (main)
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: false
tags: test-build:latest
push: ${{ github.event_name == 'push' }}
tags: ghcr.io/okteto/deploy-preview:main
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ inputs:
required: false
runs:
using: "docker"
image: "Dockerfile"
image: "docker://ghcr.io/okteto/deploy-preview:main"
args:
- ${{ inputs.name }}
- ${{ inputs.timeout }}
Expand Down