Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
Add pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrizic committed Apr 30, 2024
1 parent f0768bc commit 2da2067
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
- package-ecosystem: 'gomod'
directory: '/'
schedule:
interval: 'daily'
- package-ecosystem: 'docker'
directory: '/'
schedule:
interval: 'daily'
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Docker Image CI

on:
push:
branches: [ "main" ]
tags:
- 'v*'
pull_request:
branches: [ "main" ]

jobs:

build:

runs-on: ubuntu-latest

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

- name: Build the Docker image
run: docker build . --file Dockerfile --tag ghcr.io/prodyna/delete-from-enterprise:latest

# if tag, get the tag as variable
- name: Get tag if available
if: startsWith(github.ref, 'refs/tags/v')
run: echo "tag=${GITHUB_REF#refs/tags/*}" >> $GITHUB_ENV

# Login to the GitHub Container Registry
- name: Login to the GitHub Container Registry
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }}

# Push latest to GitHub Container Registry
- name: Push the latest Docker image to the GitHub Container Registry
run: docker push ghcr.io/prodyna/delete-from-enterprise:latest

# if tagged, push the image to the GitHub Container Registry
- name: Push the tagged Docker image to the GitHub Container Registry
if: startsWith(github.ref, 'refs/tags/v')
run: |
docker tag ghcr.io/prodyna/delete-from-enterprise:latest ghcr.io/prodyna/delete-from-enterprise:${{ env.tag }}
docker push ghcr.io/prodyna/delete-from-enterprise:${{ env.tag }}

0 comments on commit 2da2067

Please sign in to comment.