Skip to content

Commit

Permalink
ci: push image ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
uhobeike committed Jul 12, 2024
1 parent 48d665b commit 2e7f199
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/push-docker-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Docker

on:
workflow_dispatch:
schedule:
- cron: '0 9 * * *'
push:
branches:
- main
paths-ignore:
- '**/LICENSE'
- '**/*.md'
pull_request:
paths-ignore:
- '**/LICENSE'
- '**/*.md'

env:
DOCKER-CONTEXT: ./
DOCKER-FILE: ./Dockerfile

jobs:
docker:
name: Build & Push Docker Image
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
with:
context: ${{ env.DOCKER-CONTEXT }}
file: ${{ env.DOCKER-FILE }}
tags: ghcr.io/${{ github.repository_owner }}/trainee:humble
build-args: USERNAME=runner
no-cache: true
push: true

0 comments on commit 2e7f199

Please sign in to comment.