Skip to content

Commit

Permalink
Publish to dockerhub by github CI (#79)
Browse files Browse the repository at this point in the history
* Create build.yml

* Fix for build

* Only build branches of PR:s

* Testing publish script

* Lfs

* Proper config

* Build master

* Correct repository
  • Loading branch information
savpek authored Feb 16, 2024
1 parent 8f55f91 commit 2563563
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 58 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build

on:
push:
branches: [ "master" ]
pull_request:
branches: ["*"]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
lfs: "true"
- name: Build the Docker image
run: docker build . --file Dockerfile
36 changes: 36 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish Docker image

on:
release:
types: [published]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
lfs: "true"

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ptcos/pdf-storage

- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
58 changes: 0 additions & 58 deletions Jenkinsfile

This file was deleted.

0 comments on commit 2563563

Please sign in to comment.